Commit 674c5786bf604a51c4aa46bad1edceba8c724e7b
1 parent
bb5da52e
Exists in
master
and in
29 other branches
Rails3: Fix Certifier unit tests
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
test/unit/certifier_test.rb
@@ -22,10 +22,10 @@ class CertifierTest < ActiveSupport::TestCase | @@ -22,10 +22,10 @@ class CertifierTest < ActiveSupport::TestCase | ||
22 | 22 | ||
23 | should 'belongs to environment' do | 23 | should 'belongs to environment' do |
24 | env_one = fast_create(Environment) | 24 | env_one = fast_create(Environment) |
25 | - certifier_from_env_one = Certifier.create(:name => 'Certifier from environment one', :environment => env_one) | 25 | + certifier_from_env_one = env_one.certifiers.create(:name => 'Certifier from environment one') |
26 | 26 | ||
27 | env_two = fast_create(Environment) | 27 | env_two = fast_create(Environment) |
28 | - certifier_from_env_two = Certifier.create(:name => 'Certifier from environment two', :environment => env_two) | 28 | + certifier_from_env_two = env_two.certifiers.create(:name => 'Certifier from environment two') |
29 | 29 | ||
30 | assert_includes env_one.certifiers, certifier_from_env_one | 30 | assert_includes env_one.certifiers, certifier_from_env_one |
31 | assert_not_includes env_one.certifiers, certifier_from_env_two | 31 | assert_not_includes env_one.certifiers, certifier_from_env_two |
@@ -33,7 +33,7 @@ class CertifierTest < ActiveSupport::TestCase | @@ -33,7 +33,7 @@ class CertifierTest < ActiveSupport::TestCase | ||
33 | 33 | ||
34 | should 'name is mandatory' do | 34 | should 'name is mandatory' do |
35 | env_one = fast_create(Environment) | 35 | env_one = fast_create(Environment) |
36 | - certifier = Certifier.new(:environment => env_one) | 36 | + certifier = env_one.certifiers.new |
37 | assert !certifier.valid? | 37 | assert !certifier.valid? |
38 | 38 | ||
39 | certifier.name = 'Certifier name' | 39 | certifier.name = 'Certifier name' |