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 | 358 | end |
| 359 | 359 | |
| 360 | 360 | it "should destroy the app" do |
| 361 | - expect(@app).to receive(:destroy) | |
| 362 | 361 | delete :destroy, :id => @app.id |
| 362 | + expect { | |
| 363 | + @app.reload | |
| 364 | + }.to raise_error(Mongoid::Errors::DocumentNotFound) | |
| 363 | 365 | end |
| 364 | 366 | |
| 365 | 367 | it "should display a message" do |
| ... | ... | @@ -397,7 +399,7 @@ describe AppsController do |
| 397 | 399 | expect do |
| 398 | 400 | post :regenerate_api_key, :id => app.id |
| 399 | 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 | 403 | end |
| 402 | 404 | end |
| 403 | 405 | end | ... | ... |