summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-02-11 19:56:18 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-02-11 19:56:18 +0200
commitcc043f32d8bfa7da5e94061806ae56fc11902d71 (patch)
treef76367baa8b77aea900f396a5007711185f5d568 /spec
parenta769204ff489bc750c4931ecdb22ef055eac042a (diff)
downloadgitlab-ce-cc043f32d8bfa7da5e94061806ae56fc11902d71.tar.gz
Admin area improved
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/admin/admin_projects_spec.rb15
-rw-r--r--spec/requests/admin/admin_users_spec.rb14
-rw-r--r--spec/requests/admin/security_spec.rb6
3 files changed, 28 insertions, 7 deletions
diff --git a/spec/requests/admin/admin_projects_spec.rb b/spec/requests/admin/admin_projects_spec.rb
index ffa65fc255b..ceaf7245a10 100644
--- a/spec/requests/admin/admin_projects_spec.rb
+++ b/spec/requests/admin/admin_projects_spec.rb
@@ -18,7 +18,6 @@ describe "Admin::Projects" do
end
it "should have projects list" do
- page.should have_content(@project.code)
page.should have_content(@project.name)
end
end
@@ -103,4 +102,18 @@ describe "Admin::Projects" do
page.should have_content(@project.description)
end
end
+
+ describe "Add new team member" do
+ before do
+ @new_user = Factory :user
+ visit admin_project_path(@project)
+ end
+
+ it "should create new user" do
+ select @new_user.name, :from => "user_ids"
+ expect { click_button "Add" }.to change { UsersProject.count }.by(1)
+ page.should have_content @new_user.name
+ current_path.should == admin_project_path(@project)
+ end
+ end
end
diff --git a/spec/requests/admin/admin_users_spec.rb b/spec/requests/admin/admin_users_spec.rb
index aa78db99f42..91082a644b5 100644
--- a/spec/requests/admin/admin_users_spec.rb
+++ b/spec/requests/admin/admin_users_spec.rb
@@ -99,4 +99,18 @@ describe "Admin::Users" do
end
end
end
+
+ describe "Add new project" do
+ before do
+ @new_project = Factory :project
+ visit admin_user_path(@user)
+ end
+
+ it "should create new user" do
+ select @new_project.name, :from => "project_ids"
+ expect { click_button "Add" }.to change { UsersProject.count }.by(1)
+ page.should have_content @new_project.name
+ current_path.should == admin_user_path(@user)
+ end
+ end
end
diff --git a/spec/requests/admin/security_spec.rb b/spec/requests/admin/security_spec.rb
index 27b60196769..0b0edb85a37 100644
--- a/spec/requests/admin/security_spec.rb
+++ b/spec/requests/admin/security_spec.rb
@@ -13,12 +13,6 @@ describe "Admin::Projects" do
it { admin_users_path.should be_denied_for :visitor }
end
- describe "GET /admin/team_members" do
- it { admin_team_members_path.should be_allowed_for :admin }
- it { admin_team_members_path.should be_denied_for :user }
- it { admin_team_members_path.should be_denied_for :visitor }
- end
-
describe "GET /admin/emails" do
it { admin_emails_path.should be_allowed_for :admin }
it { admin_emails_path.should be_denied_for :user }