Skip to content

Instantly share code, notes, and snippets.

@sergio-fry
Created February 22, 2019 18:49
Show Gist options
  • Save sergio-fry/d788fc2a215ae0efcf7d1901dd35bd05 to your computer and use it in GitHub Desktop.
Save sergio-fry/d788fc2a215ae0efcf7d1901dd35bd05 to your computer and use it in GitHub Desktop.
Controller spec example
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
@sergio-fry
Copy link
Author

Запуск:

bundle exec rspec spec/controller/my_controller_spec.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment