Refactor factory girl usage in specs

This commit is contained in:
Thibault Jouan
2015-05-01 15:21:41 +00:00
parent 3247dd0934
commit 00fe9bf258
9 changed files with 17 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
describe Sound do
subject { sound }
let(:sound) { FactoryGirl.build(:sound) }
let(:sound) { build :sound }
it { is_expected.to be_valid }
it { is_expected.to belong_to :track }
@@ -19,7 +19,7 @@ describe Sound do
end
describe '#file=' do
let(:file) { FactoryGirl.attributes_for(:sound)[:file] }
let(:file) { attributes_for(:sound)[:file] }
it 'saves the file SHA256 digest' do
expect(sound.sha256).to eq Digest::SHA256.file(file.path).hexdigest