diff options
| author | mo <mo.khan@gmail.com> | 2017-09-23 09:13:29 -0600 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2017-09-23 09:13:29 -0600 |
| commit | afc870216e5eb02c1c73ed018d21ec2d027db041 (patch) | |
| tree | 6c96a7d40c31a131f10e2da702afc4e685d17381 /spec/controllers/admin | |
| parent | 49ee70b30b2e114622f90bcf77ded003908006aa (diff) | |
upgrade specs
Diffstat (limited to 'spec/controllers/admin')
4 files changed, 9 insertions, 9 deletions
diff --git a/spec/controllers/admin/photos_controller_spec.rb b/spec/controllers/admin/photos_controller_spec.rb index 0fe203b2..76b9e302 100644 --- a/spec/controllers/admin/photos_controller_spec.rb +++ b/spec/controllers/admin/photos_controller_spec.rb @@ -14,7 +14,7 @@ module Admin it "re-processes the photo" do allow(ReProcessPhotoJob).to receive(:perform_later) - put :update, id: photo.id + put :update, params: { id: photo.id } expect(ReProcessPhotoJob).to have_received(:perform_later).with(photo) end diff --git a/spec/controllers/admin/products_controller_spec.rb b/spec/controllers/admin/products_controller_spec.rb index 1151851f..89de9b17 100644 --- a/spec/controllers/admin/products_controller_spec.rb +++ b/spec/controllers/admin/products_controller_spec.rb @@ -20,7 +20,7 @@ module Admin product = "product" allow(product_api).to receive(:find).with(asin).and_return(product) - get :show, id: asin + get :show, params: { id: asin } expect(assigns(:product)).to eql(product) end @@ -29,14 +29,14 @@ module Admin let(:tool) { create(:tool) } it "loads the tool" do - get :show, id: tool.asin + get :show, params: { id: tool.asin } expect(assigns(:tool)).to eql(tool) end end context "when the tool is not in the toolbox" do it "does not load a tool" do - get :show, id: "not_added" + get :show, params: { id: "not_added" } expect(assigns(:tool)).to be_nil end end @@ -44,7 +44,7 @@ module Admin describe "#create" do it "creates new tool" do - post :create, {:name=>"pan", :asin=>"34234"} + post :create, params: { name: "pan", asin: "34234" } expect(Tool.count).to eql(1) expect(Tool.first.name).to eql("pan") @@ -52,7 +52,7 @@ module Admin end it "redirects back to the detail page" do - post :create, {name: 'blah', asin: 'blah' } + post :create, params: { name: 'blah', asin: 'blah' } expect(response).to redirect_to(admin_product_path('blah')) end end diff --git a/spec/controllers/admin/sessions_controller_spec.rb b/spec/controllers/admin/sessions_controller_spec.rb index 815cbd00..f494bd6e 100644 --- a/spec/controllers/admin/sessions_controller_spec.rb +++ b/spec/controllers/admin/sessions_controller_spec.rb @@ -24,7 +24,7 @@ module Admin before :each do allow(UserSession).to receive(:find).with(user_session.id).and_return(user_session) allow(user_session).to receive(:revoke!).and_return(true) - delete :destroy, id: user_session.id + delete :destroy, params: { id: user_session.id } end it "revokes the specified session" do diff --git a/spec/controllers/admin/users_controller_spec.rb b/spec/controllers/admin/users_controller_spec.rb index c2c1ad0c..5e4d3b86 100644 --- a/spec/controllers/admin/users_controller_spec.rb +++ b/spec/controllers/admin/users_controller_spec.rb @@ -21,7 +21,7 @@ module Admin repository = double allow(controller).to receive(:repository).and_return(repository) allow(repository).to receive(:search_with).and_return([matching_user]) - get :index, q: 'mo' + get :index, params: { q: 'mo' } expect(assigns(:users)).to include(matching_user) end end @@ -30,7 +30,7 @@ module Admin let!(:user) { create(:user) } it "loads the details on the specific user" do - get :show, id: user.id + get :show, params: { id: user.id } expect(assigns(:user)).to eql(user) end end |
