Created
June 11, 2012 07:57
-
-
Save Pasta/2908993 to your computer and use it in GitHub Desktop.
Revisions
-
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,14 +2,14 @@ context "when params are valid" do before { @some = Some.new(name:"Vincent", lat:48.872958, lng:2.380428) } it "should create an Thing position" do expect { post :create, homeless:{ name:@some.name, lat:@some.lat, lng:@some.lng }, format: :json }.to change(Some, :count).by 1 response.body.should be_json_eql(@some.to_json) end end context "when invalid params" do before {post :create, some:{name: "Vincent"}, format: :json } subject {response} it { should eq(422) } its(:body) {should have_json_path("errors")} end end -
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ describe "POST create" do context "when params are valid" do before { @some = Some.new(name:"Vincent", lat:48.872958, lng:2.380428) } it "should create an Thing position" do expect { post :create, homeless:{ name:@some.name, lat:@some.lat, lng:@some.lng }, format: :json }.to change(Some, :count).by 1 response.body.should be_json_eql(@some.to_json) end end context "when invalid params" do before {post :create, some:{name: "Vincent"}, format: :json } subject {response} it { should eq(422) } its(:body) {should have_json_path("errors")} end end