spec/facemock/user_spec.rb in facemock-0.0.9 vs spec/facemock/user_spec.rb in facemock-0.0.10
- old
+ new
@@ -65,28 +65,28 @@
subject { Facemock::User.new.name }
it { is_expected.to be_kind_of String }
describe '.size' do
subject { Facemock::User.new.name.size }
- it { is_expected.to be <= 10 }
+ it { is_expected.to be > 0 }
end
end
describe '.email' do
before { @user = Facemock::User.new }
subject { @user.email }
it { is_expected.to be_kind_of String }
- it { is_expected.to eq "#{@user.name}@example.com" }
+ it { is_expected.to match /^.+@.+$/ }
end
describe '.password' do
subject { Facemock::User.new.password }
it { is_expected.to be_kind_of String }
describe '.size' do
subject { Facemock::User.new.password.size }
- it { is_expected.to be <= 10 }
+ it { is_expected.to be_between(8, 16) }
end
end
describe '.installed' do
subject { Facemock::User.new.installed }
@@ -97,11 +97,11 @@
subject { Facemock::User.new.access_token }
it { is_expected.to be_kind_of String }
describe '.size' do
subject { Facemock::User.new.access_token.size }
- it { is_expected.to be <= 255 }
+ it { is_expected.to eq 255 }
end
end
describe '.application_id' do
subject { Facemock::User.new.application_id }
@@ -149,28 +149,9 @@
it { is_expected.to be_kind_of Facemock::User }
describe '.application_id' do
subject { Facemock::User.new(@opts).application_id }
it { is_expected.to be_nil }
- end
- end
-
- context 'with name option' do
- before do
- @name = "test user"
- @opts = { name: @name }
- end
- subject { Facemock::User.new(@opts) }
- it { is_expected.to be_kind_of Facemock::User }
-
- context '.name' do
- subject { Facemock::User.new(@opts).name }
- it { is_expected.to eq @name }
- end
-
- context '.email' do
- subject { Facemock::User.new(@opts).email }
- it { is_expected.to eq @name.gsub(" ", "_") + "@example.com" }
end
end
context 'with all options' do
subject { Facemock::User.new(options) }