diff --git a/app/views/team_members/_show.html.haml b/app/views/team_members/_show.html.haml
index 60b3c9b..9f023c4 100644
--- a/app/views/team_members/_show.html.haml
+++ b/app/views/team_members/_show.html.haml
@@ -1,6 +1,6 @@
- user = member.user
- allow_admin = can? current_user, :admin_project, @project
-%tr{:id => dom_id(member), :class => "team_member_row"}
+%tr{:id => dom_id(member), :class => "team_member_row user_#{user.id}"}
%td
.right
- if @project.owner == user
diff --git a/features/profile/ssh_keys.feature b/features/profile/ssh_keys.feature
index e69de29..c3a92f3 100644
--- a/features/profile/ssh_keys.feature
+++ b/features/profile/ssh_keys.feature
@@ -0,0 +1,22 @@
+Feature: SSH Keys
+ Background:
+ Given I signin as a user
+ And I have ssh keys:
+ | title |
+ | Work |
+ | Home |
+ And I visit profile keys page
+
+ Scenario: I should see SSH keys
+ Then I should see my ssh keys
+
+ Scenario: Add new ssh key
+ Given I click link "Add new"
+ And I submit new ssh key "Laptop"
+ Then I should see new ssh key "Laptop"
+
+ Scenario: Remove ssh key
+ Given I click link "Work"
+ And I click link "Remove"
+ Then I visit profile keys page
+ And I should not see "Work" ssh key
diff --git a/features/projects/team_management.feature b/features/projects/team_management.feature
index e69de29..b5b485e 100644
--- a/features/projects/team_management.feature
+++ b/features/projects/team_management.feature
@@ -0,0 +1,35 @@
+Feature: Project Team management
+ Background:
+ Given I signin as a user
+ And I own project "Shop"
+ And gitlab user "Mike"
+ And gitlab user "Sam"
+ And "Sam" is "Shop" developer
+ And I visit project "Shop" team page
+
+ Scenario: See all team members
+ Then I should be able to see myself in team
+ And I should see "Sam" in team list
+
+ Scenario: Add user to project
+ Given I click link "New Team Member"
+ And I select "Mike" as "Reporter"
+ Then I should see "Mike" in team list as "Reporter"
+
+ @javascript
+ Scenario: Update user access
+ Given I should see "Sam" in team list as "Developer"
+ And I change "Sam" role to "Reporter"
+ Then I visit project "Shop" team page
+ And I should see "Sam" in team list as "Reporter"
+
+ Scenario: View team member profile
+ Given I click link "Sam"
+ Then I should see "Sam" team profile
+
+ Scenario: Cancel team member
+ Given I click link "Sam"
+ And I click link "Remove from team"
+ Then I visit project "Shop" team page
+ And I should not see "Sam" in team list
+
diff --git a/features/step_definitions/commits_steps.rb b/features/step_definitions/commits_steps.rb
deleted file mode 100644
index 9bfccfc..0000000
--- a/features/step_definitions/commits_steps.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-Given /^I visit project commits page$/ do
- visit project_commits_path(@project)
-end
-
-Then /^I see project commits$/ do
- current_path.should == project_commits_path(@project)
-
- commit = @project.commit
- page.should have_content(@project.name)
- page.should have_content(commit.message)
- page.should have_content(commit.id.to_s[0..5])
-end
-
-Given /^I click atom feed link$/ do
- click_link "Feed"
-end
-
-Then /^I see commits atom feed$/ do
- commit = @project.commit
- page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", :text => "Recent commits to #{@project.name}")
- page.body.should have_selector("author email", :text => commit.author_email)
- page.body.should have_selector("entry summary", :text => commit.message)
-end
-
-Given /^I click on commit link$/ do
- visit project_commit_path(@project, ValidCommit::ID)
-end
-
-Then /^I see commit info$/ do
- page.should have_content ValidCommit::MESSAGE
- page.should have_content "Showing 1 changed file"
-end
-
-Given /^I visit compare refs page$/ do
- visit compare_project_commits_path(@project)
-end
-
-Given /^I fill compare fields with refs$/ do
- fill_in "from", :with => "master"
- fill_in "to", :with => "stable"
- click_button "Compare"
-end
-
-Given /^I see compared refs$/ do
- page.should have_content "Commits (27)"
- page.should have_content "Compare View"
- page.should have_content "Showing 73 changed files"
-end
-
-Given /^I visit project branches page$/ do
- visit branches_project_repository_path(@project)
-end
-
-Given /^I visit project commit page$/ do
- visit project_commit_path(@project, ValidCommit::ID)
-end
-
-Given /^I visit project tags page$/ do
- visit tags_project_repository_path(@project)
-end
diff --git a/features/step_definitions/dashboard_steps.rb b/features/step_definitions/dashboard_steps.rb
index a7353fa..ef48a85 100644
--- a/features/step_definitions/dashboard_steps.rb
+++ b/features/step_definitions/dashboard_steps.rb
@@ -47,7 +47,7 @@ Then /^I should see last push widget$/ do
end
Then /^I click "(.*?)" link$/ do |arg1|
- click_link "Create Merge Request"
+ click_link arg1 #Create Merge Request"
end
Then /^I see prefilled new Merge Request page$/ do
diff --git a/features/step_definitions/profile_keys_steps.rb b/features/step_definitions/profile_keys_steps.rb
new file mode 100644
index 0000000..5ab7e04
--- /dev/null
+++ b/features/step_definitions/profile_keys_steps.rb
@@ -0,0 +1,34 @@
+Given /^I visit profile keys page$/ do
+ visit keys_path
+end
+
+Then /^I should see my ssh keys$/ do
+ @user.keys.each do |key|
+ page.should have_content(key.title)
+ end
+end
+
+Given /^I have ssh keys:$/ do |table|
+ table.hashes.each do |row|
+ Factory :key, :user => @user, :title => row[:title], :key => "jfKLJDFKSFJSHFJ#{row[:title]}"
+ end
+end
+
+Given /^I submit new ssh key "(.*?)"$/ do |arg1|
+ fill_in "key_title", :with => arg1
+ fill_in "key_key", :with => "publickey234="
+ click_button "Save"
+end
+
+Then /^I should see new ssh key "(.*?)"$/ do |arg1|
+ key = Key.find_by_title(arg1)
+ page.should have_content(key.title)
+ page.should have_content(key.key)
+ current_path.should == key_path(key)
+end
+
+Then /^I should not see "(.*?)" ssh key$/ do |arg1|
+ within "#keys-table" do
+ page.should_not have_content(arg1)
+ end
+end
diff --git a/features/step_definitions/project_commits_steps.rb b/features/step_definitions/project_commits_steps.rb
new file mode 100644
index 0000000..9bfccfc
--- /dev/null
+++ b/features/step_definitions/project_commits_steps.rb
@@ -0,0 +1,61 @@
+Given /^I visit project commits page$/ do
+ visit project_commits_path(@project)
+end
+
+Then /^I see project commits$/ do
+ current_path.should == project_commits_path(@project)
+
+ commit = @project.commit
+ page.should have_content(@project.name)
+ page.should have_content(commit.message)
+ page.should have_content(commit.id.to_s[0..5])
+end
+
+Given /^I click atom feed link$/ do
+ click_link "Feed"
+end
+
+Then /^I see commits atom feed$/ do
+ commit = @project.commit
+ page.response_headers['Content-Type'].should have_content("application/atom+xml")
+ page.body.should have_selector("title", :text => "Recent commits to #{@project.name}")
+ page.body.should have_selector("author email", :text => commit.author_email)
+ page.body.should have_selector("entry summary", :text => commit.message)
+end
+
+Given /^I click on commit link$/ do
+ visit project_commit_path(@project, ValidCommit::ID)
+end
+
+Then /^I see commit info$/ do
+ page.should have_content ValidCommit::MESSAGE
+ page.should have_content "Showing 1 changed file"
+end
+
+Given /^I visit compare refs page$/ do
+ visit compare_project_commits_path(@project)
+end
+
+Given /^I fill compare fields with refs$/ do
+ fill_in "from", :with => "master"
+ fill_in "to", :with => "stable"
+ click_button "Compare"
+end
+
+Given /^I see compared refs$/ do
+ page.should have_content "Commits (27)"
+ page.should have_content "Compare View"
+ page.should have_content "Showing 73 changed files"
+end
+
+Given /^I visit project branches page$/ do
+ visit branches_project_repository_path(@project)
+end
+
+Given /^I visit project commit page$/ do
+ visit project_commit_path(@project, ValidCommit::ID)
+end
+
+Given /^I visit project tags page$/ do
+ visit tags_project_repository_path(@project)
+end
diff --git a/features/step_definitions/project_team_steps.rb b/features/step_definitions/project_team_steps.rb
new file mode 100644
index 0000000..f0bab29
--- /dev/null
+++ b/features/step_definitions/project_team_steps.rb
@@ -0,0 +1,63 @@
+Given /^gitlab user "(.*?)"$/ do |arg1|
+ Factory :user, :name => arg1
+end
+
+Given /^"(.*?)" is "(.*?)" developer$/ do |arg1, arg2|
+ user = User.find_by_name(arg1)
+ project = Project.find_by_name(arg2)
+ project.add_access(user, :write)
+end
+
+Given /^I visit project "(.*?)" team page$/ do |arg1|
+ visit team_project_path(Project.find_by_name(arg1))
+end
+
+Then /^I should be able to see myself in team$/ do
+ page.should have_content(@user.name)
+ page.should have_content(@user.email)
+end
+
+Then /^I should see "(.*?)" in team list$/ do |arg1|
+ user = User.find_by_name(arg1)
+ page.should have_content(user.name)
+ page.should have_content(user.email)
+end
+
+Given /^I click link "(.*?)"$/ do |arg1|
+ click_link arg1
+end
+
+Given /^I select "(.*?)" as "(.*?)"$/ do |arg1, arg2|
+ user = User.find_by_name(arg1)
+ within "#new_team_member" do
+ select user.name, :from => "team_member_user_id"
+ select arg2, :from => "team_member_project_access"
+ end
+ click_button "Save"
+end
+
+Then /^I should see "(.*?)" in team list as "(.*?)"$/ do |arg1, arg2|
+ user = User.find_by_name(arg1)
+ role_id = find(".user_#{user.id} #team_member_project_access").value
+ role_id.should == UsersProject.access_roles[arg2].to_s
+end
+
+Given /^I change "(.*?)" role to "(.*?)"$/ do |arg1, arg2|
+ user = User.find_by_name(arg1)
+ within ".user_#{user.id}" do
+ select arg2, :from => "team_member_project_access"
+ end
+end
+
+Then /^I should see "(.*?)" team profile$/ do |arg1|
+ user = User.find_by_name(arg1)
+ page.should have_content(user.name)
+ page.should have_content(user.email)
+ page.should have_content("To team list")
+end
+
+Then /^I should not see "(.*?)" in team list$/ do |arg1|
+ user = User.find_by_name(arg1)
+ page.should_not have_content(user.name)
+ page.should_not have_content(user.email)
+end
diff --git a/features/step_definitions/project_wiki_steps.rb b/features/step_definitions/project_wiki_steps.rb
new file mode 100644
index 0000000..10de38d
--- /dev/null
+++ b/features/step_definitions/project_wiki_steps.rb
@@ -0,0 +1,18 @@
+Given /^I visit project wiki page$/ do
+ visit project_wiki_path(@project, :index)
+end
+
+Given /^I create Wiki page$/ do
+ fill_in "Title", :with => 'Test title'
+ fill_in "Content", :with => '[link test](test)'
+ click_on "Save"
+end
+
+Then /^I should see newly created wiki page$/ do
+ page.should have_content("Test title")
+ page.should have_content("link test")
+
+ click_link "link test"
+
+ page.should have_content("Editing page")
+end
diff --git a/features/step_definitions/projects_steps.rb b/features/step_definitions/projects_steps.rb
index 6155e90..bca1213 100644
--- a/features/step_definitions/projects_steps.rb
+++ b/features/step_definitions/projects_steps.rb
@@ -28,7 +28,7 @@ end
Given /^I own project "(.*?)"$/ do |arg1|
@project = Factory :project, :name => arg1
- @project.add_access(@user, :read, :write)
+ @project.add_access(@user, :admin)
end
Given /^I visit project "(.*?)" wall page$/ do |arg1|
@@ -60,9 +60,9 @@ Given /^show me page$/ do
end
Given /^page should have network graph$/ do
- #page.should have_content "Project Network Graph"
- #within ".graph" do
- #page.should have_content "stable"
- #page.should have_content "notes_refacto..."
- #end
+ page.should have_content "Project Network Graph"
+ within ".graph" do
+ page.should have_content "stable"
+ page.should have_content "notes_refacto..."
+ end
end
diff --git a/features/step_definitions/wiki_steps.rb b/features/step_definitions/wiki_steps.rb
deleted file mode 100644
index 10de38d..0000000
--- a/features/step_definitions/wiki_steps.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-Given /^I visit project wiki page$/ do
- visit project_wiki_path(@project, :index)
-end
-
-Given /^I create Wiki page$/ do
- fill_in "Title", :with => 'Test title'
- fill_in "Content", :with => '[link test](test)'
- click_on "Save"
-end
-
-Then /^I should see newly created wiki page$/ do
- page.should have_content("Test title")
- page.should have_content("link test")
-
- click_link "link test"
-
- page.should have_content("Editing page")
-end
--
libgit2 0.21.2