added more to the spec test for creating a new link
parent
3421e18f21
commit
7d6c098047
|
|
@ -14,8 +14,13 @@ end
|
||||||
describe "Submit API request to create new link" do
|
describe "Submit API request to create new link" do
|
||||||
include Rack::Test::Methods
|
include Rack::Test::Methods
|
||||||
it "should return link data in json format" do
|
it "should return link data in json format" do
|
||||||
post '/create'
|
data = {
|
||||||
last_response.should be_ok
|
url: 'http://google.com'
|
||||||
|
}
|
||||||
|
res = post('/create', data.to_json, "CONTENT_TYPE" => "application/json")
|
||||||
|
expect(last_response).to be_ok
|
||||||
|
expect(JSON.parse(last_response.body)['url']).to eq(data[:url])
|
||||||
|
expect(JSON.parse(last_response.body)['code']).not_to eq(nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue