Commit 9c4a428d85feaf89b6677425f96aef4141af8138
1 parent
5d85f339
Exists in
master
and in
1 other branch
fix tests
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
spec/controllers/apps_controller_spec.rb
@@ -358,8 +358,10 @@ describe AppsController do | @@ -358,8 +358,10 @@ describe AppsController do | ||
358 | end | 358 | end |
359 | 359 | ||
360 | it "should destroy the app" do | 360 | it "should destroy the app" do |
361 | - expect(@app).to receive(:destroy) | ||
362 | delete :destroy, :id => @app.id | 361 | delete :destroy, :id => @app.id |
362 | + expect { | ||
363 | + @app.reload | ||
364 | + }.to raise_error(Mongoid::Errors::DocumentNotFound) | ||
363 | end | 365 | end |
364 | 366 | ||
365 | it "should display a message" do | 367 | it "should display a message" do |
@@ -397,7 +399,7 @@ describe AppsController do | @@ -397,7 +399,7 @@ describe AppsController do | ||
397 | expect do | 399 | expect do |
398 | post :regenerate_api_key, :id => app.id | 400 | post :regenerate_api_key, :id => app.id |
399 | expect(request).to redirect_to edit_app_path(app) | 401 | expect(request).to redirect_to edit_app_path(app) |
400 | - end.to change { app.api_key } | 402 | + end.to change { app.reload.api_key } |
401 | end | 403 | end |
402 | end | 404 | end |
403 | end | 405 | end |