From ef7eeb8ed18092bde97ebc30d249d32e56d5645f Mon Sep 17 00:00:00 2001 From: mo khan Date: Sat, 22 Feb 2014 11:12:06 -0700 Subject: found a weird bug with jbuilder and trying to render the location json node. --- spec/controllers/v1/licenses_controller_spec.rb | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'spec') diff --git a/spec/controllers/v1/licenses_controller_spec.rb b/spec/controllers/v1/licenses_controller_spec.rb index e8538d0..ca51f95 100644 --- a/spec/controllers/v1/licenses_controller_spec.rb +++ b/spec/controllers/v1/licenses_controller_spec.rb @@ -7,7 +7,7 @@ describe V1::LicensesController do it "returns the first page of licenses" do License.stub(:most_recent).with(page: 1, per_page: 10).and_return(licenses) - xhr :get, :index + get :index response.should be_success assigns(:licenses).should == licenses @@ -16,7 +16,7 @@ describe V1::LicensesController do it "returns the second page of licenses" do License.stub(:most_recent).with(page: 2, per_page: 10).and_return(licenses) - xhr :get, :index, page: 2 + get :index, page: 2 response.should be_success assigns(:licenses).should == licenses @@ -25,17 +25,10 @@ describe V1::LicensesController do it "returns the specified number of results" do License.stub(:most_recent).with(page: 1, per_page: 100).and_return(licenses) - xhr :get, :index, per_page: 100 + get :index, per_page: 100 response.should be_success assigns(:licenses).should == licenses end - - it "returns a json response" do - License.stub(:most_recent).with(page: 1, per_page: 10).and_return(licenses) - - xhr :get, :index - -> { JSON.parse(response.body) }.should_not raise_error - end end describe :show do @@ -43,15 +36,11 @@ describe V1::LicensesController do before :each do License.stub(:find).with(license.id).and_return(license) - xhr :get, :show, id: license.id + get :show, id: license.id end it "returns the correct license" do assigns(:license).should == license end - - it "returns a json response" do - expect(-> { JSON.parse(response.body) }).not_to raise_error - end end end -- cgit v1.2.3