Skip to content

Commit

Permalink
moved users test setup to account test
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmh committed Jun 25, 2009
1 parent 1a0f956 commit fcafef6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
10 changes: 0 additions & 10 deletions engines/adva_user/test/contexts.rb
Expand Up @@ -39,14 +39,4 @@ def valid_user_params
share :invalid_user_params do
before { @params = { :user => valid_user_params.update(:password => '') } }
end

share :users do
before do
@user1 = User.find_by_name('user1')
@user2 = User.find_by_name('user2')
@user3 = User.find_by_name('user3')
@user4 = User.find_by_name('user4')
end
end

end
17 changes: 10 additions & 7 deletions engines/adva_user/test/unit/models/account_test.rb
Expand Up @@ -3,16 +3,19 @@
class AccountTest < ActiveSupport::TestCase
def setup
super
@user1 = User.find_by_first_name('user1')
@user2 = User.find_by_first_name('user2')
@user3 = User.find_by_first_name('user3')
@user4 = User.find_by_first_name('user4')

@account = Account.find_by_name('Account1')
end

test 'creation' do
with :users do
@account.name.should == 'Account1'
@account.users.should include(@user1)
@account.users.should include(@user2)
@account.users.should include(@user3)
@account.users.should exclude(@user4)
end
@account.name.should == 'Account1'
@account.users.should include(@user1)
@account.users.should include(@user2)
@account.users.should include(@user3)
@account.users.should exclude(@user4)
end
end

0 comments on commit fcafef6

Please sign in to comment.