Commit d1bde7149075c65654d5d24db1460843f8d564bc

Authored by Cyril Mougel
1 parent 02d68220
Exists in master and in 1 other branch production

fix spec/model/watcher with fabrication_gem

Showing 1 changed file with 5 additions and 5 deletions   Show diff stats
spec/models/watcher_spec.rb
@@ -4,7 +4,7 @@ describe Watcher do @@ -4,7 +4,7 @@ describe Watcher do
4 4
5 context 'validations' do 5 context 'validations' do
6 it 'requires an email address or an associated user' do 6 it 'requires an email address or an associated user' do
7 - watcher = Factory.build(:watcher, :email => nil, :user => nil) 7 + watcher = Fabricate.build(:watcher, :email => nil, :user => nil)
8 watcher.should_not be_valid 8 watcher.should_not be_valid
9 watcher.errors[:base].should include("You must specify either a user or an email address") 9 watcher.errors[:base].should include("You must specify either a user or an email address")
10 10
@@ -14,7 +14,7 @@ describe Watcher do @@ -14,7 +14,7 @@ describe Watcher do
14 watcher.email = nil 14 watcher.email = nil
15 watcher.should_not be_valid 15 watcher.should_not be_valid
16 16
17 - watcher.user = Factory(:user) 17 + watcher.user = Fabricate(:user)
18 watcher.watcher_type = 'user' 18 watcher.watcher_type = 'user'
19 watcher.should be_valid 19 watcher.should be_valid
20 end 20 end
@@ -22,13 +22,13 @@ describe Watcher do @@ -22,13 +22,13 @@ describe Watcher do
22 22
23 context 'address' do 23 context 'address' do
24 it "returns the user's email address if there is a user" do 24 it "returns the user's email address if there is a user" do
25 - user = Factory(:user, :email => 'foo@bar.com')  
26 - watcher = Factory(:user_watcher, :user => user) 25 + user = Fabricate(:user, :email => 'foo@bar.com')
  26 + watcher = Fabricate(:user_watcher, :user => user)
27 watcher.address.should == 'foo@bar.com' 27 watcher.address.should == 'foo@bar.com'
28 end 28 end
29 29
30 it "returns the email if there is no user" do 30 it "returns the email if there is no user" do
31 - watcher = Factory(:watcher, :email => 'widgets@acme.com') 31 + watcher = Fabricate(:watcher, :email => 'widgets@acme.com')
32 watcher.address.should == 'widgets@acme.com' 32 watcher.address.should == 'widgets@acme.com'
33 end 33 end
34 end 34 end