diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-30 15:03:44 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-30 15:03:44 -0700 |
commit | 1c5a393c959303839566a5fdbef9fa1bfaea2f63 (patch) | |
tree | d63d7225386cff2833fccc7b9ede9aa6c461f8c0 /spec | |
parent | 52ae054447980f2efb775e43adbe5ad4bcf575e6 (diff) | |
parent | b8502cbaeeb843f579221664289f3ff93be3df67 (diff) | |
download | gitlab-ce-1c5a393c959303839566a5fdbef9fa1bfaea2f63.tar.gz |
Merge pull request #3406 from docwhat/in_projects
Fixed UsersProject.in_projects
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/user_team_spec.rb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/spec/models/user_team_spec.rb b/spec/models/user_team_spec.rb index 6cc2003e97d..d330bbf3e33 100644 --- a/spec/models/user_team_spec.rb +++ b/spec/models/user_team_spec.rb @@ -14,5 +14,24 @@ require 'spec_helper' describe UserTeam do - pending "add some examples to (or delete) #{__FILE__}" + let(:team) { FactoryGirl.create :user_team } + + context ".add_member" do + let(:user) { FactoryGirl.create :user } + + it "should work" do + team.add_member(user, UsersProject::DEVELOPER, false) + team.members.should include(user) + end + end + + context ".remove_member" do + let(:user) { FactoryGirl.create :user } + before { team.add_member(user, UsersProject::DEVELOPER, false) } + + it "should work" do + team.remove_member(user) + team.members.should_not include(user) + end + end end |