Remove `should' usages in specs
This commit is contained in:
parent
1a39db3909
commit
d58c9ba0cb
@ -2,8 +2,8 @@ describe Playlist do
|
||||
subject { playlist }
|
||||
let(:playlist) { FactoryGirl.build(:playlist) }
|
||||
|
||||
it { should be_valid }
|
||||
it { should belong_to :user }
|
||||
it { should validate_presence_of :user }
|
||||
it { should validate_presence_of :name }
|
||||
it { is_expected.to be_valid }
|
||||
it { is_expected.to belong_to :user }
|
||||
it { is_expected.to validate_presence_of :user }
|
||||
it { is_expected.to validate_presence_of :name }
|
||||
end
|
||||
|
@ -2,10 +2,10 @@ describe Sound do
|
||||
subject { sound }
|
||||
let(:sound) { FactoryGirl.build(:sound) }
|
||||
|
||||
it { should be_valid }
|
||||
it { should belong_to :track }
|
||||
it { should validate_presence_of :sha256 }
|
||||
it { should validate_presence_of :mime_type }
|
||||
it { is_expected.to be_valid }
|
||||
it { is_expected.to belong_to :track }
|
||||
it { is_expected.to validate_presence_of :sha256 }
|
||||
it { is_expected.to validate_presence_of :mime_type }
|
||||
|
||||
describe '#path' do
|
||||
it 'starts by the path specified in Rails.configuration.sound_path' do
|
||||
|
@ -3,14 +3,14 @@ describe Track do
|
||||
let(:track) { FactoryGirl.build(:track) }
|
||||
let(:file) { FactoryGirl.attributes_for(:track_with_sound)[:file] }
|
||||
|
||||
it { should be_valid }
|
||||
it { should have_many :sounds }
|
||||
it { should validate_presence_of :name }
|
||||
it { is_expected.to be_valid }
|
||||
it { is_expected.to have_many :sounds }
|
||||
it { is_expected.to validate_presence_of :name }
|
||||
|
||||
context 'with a file' do
|
||||
before { track.file = file }
|
||||
|
||||
it { should be_valid }
|
||||
it { is_expected.to be_valid }
|
||||
|
||||
it 'creates a sound for the track' do
|
||||
expect {
|
||||
|
@ -1,17 +1,17 @@
|
||||
describe User do
|
||||
subject(:user) { FactoryGirl.build(:user) }
|
||||
|
||||
it { should be_valid }
|
||||
it { should have_many :playlists }
|
||||
it { should validate_presence_of :email }
|
||||
it { should validate_presence_of :password }
|
||||
it { should validate_presence_of :password_hash }
|
||||
it { is_expected.to be_valid }
|
||||
it { is_expected.to have_many :playlists }
|
||||
it { is_expected.to validate_presence_of :email }
|
||||
it { is_expected.to validate_presence_of :password }
|
||||
it { is_expected.to validate_presence_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(:user) { FactoryGirl.build(:user, email: old_user.email) }
|
||||
|
||||
it { should_not be_valid }
|
||||
it { is_expected.to_not be_valid }
|
||||
|
||||
it 'has an error on email attribute' do
|
||||
user.valid?
|
||||
@ -22,7 +22,7 @@ describe User do
|
||||
context 'when password_confirmation does not match password' do
|
||||
before { user.password_confirmation = user.password + 'INVALID' }
|
||||
|
||||
it { should_not be_valid }
|
||||
it { is_expected.to_not be_valid }
|
||||
end
|
||||
|
||||
describe '#password=' do
|
||||
|
Loading…
x
Reference in New Issue
Block a user