Created
February 22, 2019 18:49
-
-
Save sergio-fry/d788fc2a215ae0efcf7d1901dd35bd05 to your computer and use it in GitHub Desktop.
Controller spec example
This file contains 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 characters
require 'rails_helper' | |
RSpec.describe MyController, type: :controller do | |
describe 'GET #index' do | |
render_views | |
include_context 'with admin authenticated' | |
it 'returns http success' do | |
get :index, params: params | |
expect(response).to have_http_status(:success) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Запуск:
bundle exec rspec spec/controller/my_controller_spec.rb