Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. require 'rails_helper'
  2.  
  3. RSpec.describe V1::AppsController, type: :controller do
  4. let(:user) { create(:user) }
  5.  
  6. describe '[mention] DELETE destroy when you are not logged in' do
  7. let(:app) { create(:app, account: user.account) }
  8. let(:make_request) { delete :destroy, id: app, format: :json }
  9.  
  10. it 'does not delete the app (.count)' do
  11. app
  12. expect { make_request }.not_to change(App, :count)
  13. end
  14. end
  15.  
  16. describe '[let] DELETE destroy when you are not logged in' do
  17. let(:app) { create(:app, account: user.account) }
  18. let(:make_request) { delete :destroy, id: app, format: :json }
  19.  
  20. it 'does not delete the app (.count)' do
  21. expect { make_request }.not_to change(App, :count)
  22. end
  23. end
  24.  
  25. describe '[let!] DELETE destroy when you are not logged in' do
  26. let!(:app) { create(:app, account: user.account) }
  27. let(:make_request) { delete :destroy, id: app, format: :json }
  28.  
  29. it 'does not delete the app (.count)' do
  30. expect { make_request }.not_to change(App, :count)
  31. end
  32. end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement