Use ruby 2.x hash syntax

This commit is contained in:
Thibault Jouan
2014-04-01 10:48:18 +00:00
parent 712e9501a2
commit da96c4814a
52 changed files with 148 additions and 148 deletions

View File

@@ -27,8 +27,8 @@ describe Track do
describe '#file=' do
it 'builds a new related sound with the file' do
sounds = double 'sounds association proxy'
track.stub(:sounds => sounds)
sounds.should_receive(:build).with({:file => file})
track.stub(sounds: sounds)
sounds.should_receive(:build).with({file: file})
track.file = file
end
end
@@ -65,8 +65,8 @@ describe Track do
describe '.latest' do
it 'returns latest tracks in descending creation date order' 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')
track1 = FactoryGirl.create(:track, created_at: '2011-07-27 19:13:42')
track2 = FactoryGirl.create(:track, created_at: '2011-07-27 19:58:57')
Track.latest.should == [track2, track1]
end
end

View File

@@ -12,8 +12,8 @@ describe User do
it { should_not allow_mass_assignment_of :password_hash }
context 'when a user with the same email address already exists' do
let(:old_user) { FactoryGirl.create(:user, :email => 'unique@example.net') }
subject { FactoryGirl.build(:user, :email => old_user.email) }
let(:old_user) { FactoryGirl.create(:user, email: 'unique@example.net') }
subject { FactoryGirl.build(:user, email: old_user.email) }
it { should_not be_valid }