Fix coding standards in specs

This commit is contained in:
Thibault Jouan
2014-04-01 19:14:11 +00:00
parent e6f6475705
commit 2acf0371b5
10 changed files with 16 additions and 17 deletions

View File

@@ -9,8 +9,8 @@ describe API::PlaylistsController do
render_views
before do
playlist_1 = FactoryGirl.create(:playlist, name: 'Playlist 1')
playlist_2 = FactoryGirl.create(:playlist, name: 'Playlist 2')
FactoryGirl.create(:playlist, name: 'Playlist 1')
FactoryGirl.create(:playlist, name: 'Playlist 2')
end
def do_get

View File

@@ -13,8 +13,8 @@ describe HomeController do
end
it 'assigns latest tracks as @tracks' do
track1 = FactoryGirl.create(:track, created_at: '2011-07-27 19:13:42')
track2 = FactoryGirl.create(:track, created_at: '2011-07-27 19:58:57')
FactoryGirl.create(:track, created_at: '2011-07-27 19:13:42')
FactoryGirl.create(:track, created_at: '2011-07-27 19:58:57')
get :index
expect(assigns[:tracks]).to eq Track.latest
end

View File

@@ -62,7 +62,7 @@ describe PlaylistsController do
end
describe 'PUT update' do
let (:playlist) { FactoryGirl.create(:playlist) }
let(:playlist) { FactoryGirl.create(:playlist) }
def do_update
put :update, id: playlist.id.to_s, playlist: { name: 'Rock' }
@@ -71,7 +71,7 @@ describe PlaylistsController do
context 'whith valid params' do
it 'updates the playlist' do
expect_any_instance_of(Playlist)
.to receive(:update_attributes).with({'name' => 'Rock'})
.to receive(:update_attributes).with('name' => 'Rock')
do_update
end

View File

@@ -22,12 +22,12 @@ describe TracksController do
describe 'POST create new' do
def do_create
post :create, track: FactoryGirl.attributes_for(:track).merge({
post :create, track: FactoryGirl.attributes_for(:track).merge(
file: fixture_file_upload(
"#{Rails.root}/spec/fixtures/test.mp3",
'audio/mpeg'
)
})
)
end
context 'whith valid params' do