Use one-liners in specs where possible
This commit is contained in:
@@ -3,14 +3,10 @@ require 'spec_helper'
|
||||
describe API::ApplicationController do
|
||||
include UserControllerHelpers
|
||||
|
||||
before do
|
||||
sign_in
|
||||
end
|
||||
before { sign_in }
|
||||
|
||||
context 'CORS: Cross-Origin Ressource Sharing' do
|
||||
before do
|
||||
request.headers['Origin'] = 'http://origin.example/'
|
||||
end
|
||||
before { request.headers['Origin'] = 'http://origin.example/' }
|
||||
|
||||
context 'preflight' do
|
||||
controller(API::ApplicationController) do
|
||||
|
@@ -3,9 +3,7 @@ require 'spec_helper'
|
||||
describe API::PlaylistsController do
|
||||
include UserControllerHelpers
|
||||
|
||||
before do
|
||||
sign_in
|
||||
end
|
||||
before { sign_in }
|
||||
|
||||
describe 'GET index' do
|
||||
render_views
|
||||
|
@@ -12,9 +12,7 @@ describe API::SessionsController do
|
||||
end
|
||||
|
||||
context 'with valid credentials' do
|
||||
before do
|
||||
do_create
|
||||
end
|
||||
before { do_create }
|
||||
|
||||
it 'signs the user in' do
|
||||
expect(controller.current_user).to eq user
|
||||
|
@@ -3,9 +3,7 @@ require 'spec_helper'
|
||||
describe API::TracksController do
|
||||
include UserControllerHelpers
|
||||
|
||||
before do
|
||||
sign_in
|
||||
end
|
||||
before { sign_in }
|
||||
|
||||
describe 'GET index' do
|
||||
render_views
|
||||
|
@@ -3,9 +3,7 @@ require 'spec_helper'
|
||||
describe HomeController do
|
||||
include UserControllerHelpers
|
||||
|
||||
before do
|
||||
sign_in
|
||||
end
|
||||
before { sign_in }
|
||||
|
||||
describe 'GET index' do
|
||||
it 'assigns all playlists as @playlists' do
|
||||
|
@@ -3,9 +3,7 @@ require 'spec_helper'
|
||||
describe PlaylistsController do
|
||||
include UserControllerHelpers
|
||||
|
||||
before do
|
||||
sign_in
|
||||
end
|
||||
before { sign_in }
|
||||
|
||||
describe 'GET index' do
|
||||
it 'assigns all playlists as @playlists' do
|
||||
|
@@ -3,9 +3,7 @@ require 'spec_helper'
|
||||
describe SoundsController do
|
||||
include UserControllerHelpers
|
||||
|
||||
before do
|
||||
sign_in
|
||||
end
|
||||
before { sign_in }
|
||||
|
||||
describe 'GET show' do
|
||||
let(:sound) { FactoryGirl.create(:sound) }
|
||||
|
@@ -3,9 +3,7 @@ require 'spec_helper'
|
||||
describe TracksController do
|
||||
include UserControllerHelpers
|
||||
|
||||
before do
|
||||
sign_in
|
||||
end
|
||||
before { sign_in }
|
||||
|
||||
describe 'GET show' do
|
||||
it 'assigns the requested track as @track' do
|
||||
@@ -46,9 +44,7 @@ describe TracksController do
|
||||
end
|
||||
|
||||
context 'whith invalid params' do
|
||||
before do
|
||||
allow_any_instance_of(Track).to receive(:save) { false }
|
||||
end
|
||||
before { allow_any_instance_of(Track).to receive(:save) { false } }
|
||||
|
||||
it 'assigns the track as @track' do
|
||||
do_create
|
||||
|
Reference in New Issue
Block a user