From 080bd12e167dceb3274bb488b7be787379d126b4 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Mon, 10 Sep 2012 04:27:11 -0700 Subject: [PATCH] rewrite project commits features using spinach --- features/project/commits/branches.feature | 26 ++++++++++++++++++++++++++ features/project/commits/commit_comments.feature | 10 ++++++++++ features/project/commits/commits.feature | 21 +++++++++++++++++++++ features/project/commits/tags.feature | 11 +++++++++++ features/project/create_project.feature | 11 +++++++++++ features/project/deploy_keys.feature | 0 features/project/issues/issues.feature | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ features/project/issues/labels.feature | 13 +++++++++++++ features/project/issues/milestones.feature | 18 ++++++++++++++++++ features/project/merge_requests.feature | 42 ++++++++++++++++++++++++++++++++++++++++++ features/project/network.feature | 10 ++++++++++ features/project/project.feature | 11 +++++++++++ features/project/snippets.feature | 0 features/project/source/browse_files.feature | 23 +++++++++++++++++++++++ features/project/source/git_blame.feature | 10 ++++++++++ features/project/team_management.feature | 35 +++++++++++++++++++++++++++++++++++ features/project/wall.feature | 17 +++++++++++++++++ features/project/web_hooks.feature | 0 features/project/wiki.feature | 15 +++++++++++++++ features/projects/commits/branches.feature | 23 ----------------------- features/projects/commits/commit_comments.feature | 10 ---------- features/projects/commits/commits.feature | 22 ---------------------- features/projects/commits/tags.feature | 10 ---------- features/projects/create_project.feature | 11 ----------- features/projects/deploy_keys.feature | 0 features/projects/issues/issues.feature | 82 ---------------------------------------------------------------------------------- features/projects/issues/labels.feature | 13 ------------- features/projects/issues/milestones.feature | 18 ------------------ features/projects/merge_requests.feature | 42 ------------------------------------------ features/projects/network.feature | 10 ---------- features/projects/project.feature | 11 ----------- features/projects/snippets.feature | 0 features/projects/source/browse_files.feature | 23 ----------------------- features/projects/source/git_blame.feature | 10 ---------- features/projects/team_management.feature | 35 ----------------------------------- features/projects/wall.feature | 17 ----------------- features/projects/web_hooks.feature | 0 features/projects/wiki.feature | 15 --------------- features/steps/project_browse_branches.rb | 44 ++++++++++++++++++++++++++++++++++++++++++++ features/steps/project_browse_commits.rb | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ features/steps/project_browse_tags.rb | 19 +++++++++++++++++++ features/steps/project_comment_commit.rb | 23 +++++++++++++++++++++++ features/support/env.rb | 13 +++++++++++-- 43 files changed, 512 insertions(+), 354 deletions(-) create mode 100644 features/project/commits/branches.feature create mode 100644 features/project/commits/commit_comments.feature create mode 100644 features/project/commits/commits.feature create mode 100644 features/project/commits/tags.feature create mode 100644 features/project/create_project.feature create mode 100644 features/project/deploy_keys.feature create mode 100644 features/project/issues/issues.feature create mode 100644 features/project/issues/labels.feature create mode 100644 features/project/issues/milestones.feature create mode 100644 features/project/merge_requests.feature create mode 100644 features/project/network.feature create mode 100644 features/project/project.feature create mode 100644 features/project/snippets.feature create mode 100644 features/project/source/browse_files.feature create mode 100644 features/project/source/git_blame.feature create mode 100644 features/project/team_management.feature create mode 100644 features/project/wall.feature create mode 100644 features/project/web_hooks.feature create mode 100644 features/project/wiki.feature delete mode 100644 features/projects/commits/branches.feature delete mode 100644 features/projects/commits/commit_comments.feature delete mode 100644 features/projects/commits/commits.feature delete mode 100644 features/projects/commits/tags.feature delete mode 100644 features/projects/create_project.feature delete mode 100644 features/projects/deploy_keys.feature delete mode 100644 features/projects/issues/issues.feature delete mode 100644 features/projects/issues/labels.feature delete mode 100644 features/projects/issues/milestones.feature delete mode 100644 features/projects/merge_requests.feature delete mode 100644 features/projects/network.feature delete mode 100644 features/projects/project.feature delete mode 100644 features/projects/snippets.feature delete mode 100644 features/projects/source/browse_files.feature delete mode 100644 features/projects/source/git_blame.feature delete mode 100644 features/projects/team_management.feature delete mode 100644 features/projects/wall.feature delete mode 100644 features/projects/web_hooks.feature delete mode 100644 features/projects/wiki.feature create mode 100644 features/steps/project_browse_branches.rb create mode 100644 features/steps/project_browse_commits.rb create mode 100644 features/steps/project_browse_tags.rb create mode 100644 features/steps/project_comment_commit.rb diff --git a/features/project/commits/branches.feature b/features/project/commits/branches.feature new file mode 100644 index 0000000..4fa4dc2 --- /dev/null +++ b/features/project/commits/branches.feature @@ -0,0 +1,26 @@ +Feature: Project Browse branches + Background: + Given I sign in as a user + And I own project "Shop" + And project "Shop" has protected branches + Given I visit project branches page + + Scenario: I can see project recent git branches + Then I should see "Shop" recent branches list + + Scenario: I can see project all git branches + Given I click link "All" + Then I should see "Shop" all branches list + + Scenario: I can see project protected git branches + Given I click link "Protected" + Then I should see "Shop" protected branches list + + # @wip + # Scenario: I can download project by branch + + # @wip + # Scenario: I can view protected branches + + # @wip + # Scenario: I can manage protected branches diff --git a/features/project/commits/commit_comments.feature b/features/project/commits/commit_comments.feature new file mode 100644 index 0000000..5acf541 --- /dev/null +++ b/features/project/commits/commit_comments.feature @@ -0,0 +1,10 @@ +Feature: Project Comment commit + Background: + Given I sign in as a user + And I own project "Shop" + Given I visit project commit page + + @javascript + Scenario: I comment commit + Given I leave a comment like "XML attached" + Then I should see comment "XML attached" diff --git a/features/project/commits/commits.feature b/features/project/commits/commits.feature new file mode 100644 index 0000000..53de6e6 --- /dev/null +++ b/features/project/commits/commits.feature @@ -0,0 +1,21 @@ +Feature: Project Browse commits + Background: + Given I sign in as a user + And I own project "Shop" + Given I visit project commits page + + Scenario: I browse commits list for master branch + Then I see project commits + + Scenario: I browse atom feed of commits list for master branch + Given I click atom feed link + Then I see commits atom feed + + Scenario: I browse commit from list + Given I click on commit link + Then I see commit info + + Scenario: I compare refs + Given I visit compare refs page + And I fill compare fields with refs + And I see compared refs diff --git a/features/project/commits/tags.feature b/features/project/commits/tags.feature new file mode 100644 index 0000000..1ac0f8b --- /dev/null +++ b/features/project/commits/tags.feature @@ -0,0 +1,11 @@ +Feature: Project Browse tags + Background: + Given I sign in as a user + And I own project "Shop" + Given I visit project tags page + + Scenario: I can see all git tags + Then I should see "Shop" all tags list + + # @wip + # Scenario: I can download project by tag diff --git a/features/project/create_project.feature b/features/project/create_project.feature new file mode 100644 index 0000000..42d25b3 --- /dev/null +++ b/features/project/create_project.feature @@ -0,0 +1,11 @@ +Feature: Create Project + In order to get access to project sections + A user with ability to create a project + Should be able to create a new one + + Scenario: User create a project + Given I signin as a user + When I visit new project page + And fill project form with valid data + Then I should see project page + And I should see empty project instuctions diff --git a/features/project/deploy_keys.feature b/features/project/deploy_keys.feature new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/features/project/deploy_keys.feature diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature new file mode 100644 index 0000000..b2301b3 --- /dev/null +++ b/features/project/issues/issues.feature @@ -0,0 +1,82 @@ +Feature: Issues + Background: + Given I signin as a user + And I own project "Shop" + And project "Shop" have "Release 0.4" open issue + And project "Shop" have "Release 0.3" closed issue + And I visit project "Shop" issues page + + Scenario: I should see open issues + Given I should see "Release 0.4" in issues + And I should not see "Release 0.3" in issues + + Scenario: I should see closed issues + Given I click link "Closed" + Then I should see "Release 0.3" in issues + And I should not see "Release 0.4" in issues + + Scenario: I should see all issues + Given I click link "All" + Then I should see "Release 0.3" in issues + And I should see "Release 0.4" in issues + + Scenario: I visit issue page + Given I click link "Release 0.4" + Then I should see issue "Release 0.4" + + @javascript + Scenario: I submit new unassigned issue + Given I click link "New Issue" + And I submit new issue "500 error on profile" + Given I click link "500 error on profile" + Then I should see issue "500 error on profile" + + @javascript + Scenario: I comment issue + Given I visit issue page "Release 0.4" + And I leave a comment like "XML attached" + Then I should see comment "XML attached" + + @javascript + Scenario: I search issue + Given I fill in issue search with "Release" + Then I should see "Release 0.4" in issues + And I should not see "Release 0.3" in issues + + @javascript + Scenario: I search issue that not exist + Given I fill in issue search with "Bug" + Then I should not see "Release 0.4" in issues + And I should not see "Release 0.3" in issues + + + @javascript + Scenario: I search all issues + Given I click link "All" + And I fill in issue search with "0.3" + Then I should see "Release 0.3" in issues + And I should not see "Release 0.4" in issues + + @javascript + Scenario: I clear search + Given I click link "All" + And I fill in issue search with "Something" + And I fill in issue search with "" + Then I should see "Release 0.4" in issues + And I should see "Release 0.3" in issues + + @javascript + Scenario: I create Issue with pre-selected milestone + Given project "Shop" has milestone "v2.2" + And project "Shop" has milestone "v3.0" + And I visit project "Shop" issues page + When I select milestone "v3.0" + And I click link "New Issue" + Then I should see selected milestone with title "v3.0" + + @javascript + Scenario: I create Issue with pre-selected assignee + When I select first assignee from "Shop" project + And I click link "New Issue" + Then I should see first assignee from "Shop" as selected assignee + diff --git a/features/project/issues/labels.feature b/features/project/issues/labels.feature new file mode 100644 index 0000000..5a20bfd --- /dev/null +++ b/features/project/issues/labels.feature @@ -0,0 +1,13 @@ +Feature: Labels + Background: + Given I signin as a user + And I own project "Shop" + And project "Shop" have issues tags: + | name | + | bug | + | feature | + Given I visit project "Shop" labels page + + Scenario: I should see active milestones + Then I should see label "bug" + And I should see label "feature" diff --git a/features/project/issues/milestones.feature b/features/project/issues/milestones.feature new file mode 100644 index 0000000..d78096a --- /dev/null +++ b/features/project/issues/milestones.feature @@ -0,0 +1,18 @@ +Feature: Milestones + Background: + Given I signin as a user + And I own project "Shop" + And project "Shop" has milestone "v2.2" + Given I visit project "Shop" milestones page + + Scenario: I should see active milestones + Then I should see milestone "v2.2" + + Scenario: I should see milestone + Given I click link "v2.2" + Then I should see milestone "v2.2" + + Scenario: I create new milestone + Given I click link "New Milestone" + And I submit new milestone "v2.3" + Then I should see milestone "v2.3" diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature new file mode 100644 index 0000000..54b6ccd --- /dev/null +++ b/features/project/merge_requests.feature @@ -0,0 +1,42 @@ +Feature: Merge Requests + Background: + Given I signin as a user + And I own project "Shop" + And project "Shop" have "Bug NS-04" open merge request + And project "Shop" have "Feature NS-03" closed merge request + And I visit project "Shop" merge requests page + + Scenario: I should see open merge requests + Then I should see "Bug NS-04" in merge requests + And I should not see "Feature NS-03" in merge requests + + Scenario: I should see closed merge requests + Given I click link "Closed" + Then I should see "Feature NS-03" in merge requests + And I should not see "Bug NS-04" in merge requests + + Scenario: I should see all merge requests + Given I click link "All" + Then I should see "Feature NS-03" in merge requests + And I should see "Bug NS-04" in merge requests + + Scenario: I visit merge request page + Given I click link "Bug NS-04" + Then I should see merge request "Bug NS-04" + + Scenario: I close merge request page + Given I click link "Bug NS-04" + And I click link "Close" + Then I should see closed merge request "Bug NS-04" + + Scenario: I submit new unassigned merge request + Given I click link "New Merge Request" + And I submit new merge request "Wiki Feature" + Then I should see merge request "Wiki Feature" + + @javascript + Scenario: I comment merge request + Given I visit merge request page "Bug NS-04" + And I leave a comment like "XML attached" + Then I should see comment "XML attached" + diff --git a/features/project/network.feature b/features/project/network.feature new file mode 100644 index 0000000..61c05eb --- /dev/null +++ b/features/project/network.feature @@ -0,0 +1,10 @@ +@javascript +Feature: Project Network Graph + + Background: + Given I signin as a user + And I own project "Shop" + And I visit project "Shop" network page + + Scenario: I should see project network + Then page should have network graph diff --git a/features/project/project.feature b/features/project/project.feature new file mode 100644 index 0000000..895a928 --- /dev/null +++ b/features/project/project.feature @@ -0,0 +1,11 @@ +Feature: Project + Background: + Given I signin as a user + And I own project "Shop" + And I visit project "Shop" page + + Scenario: I should see project activity + + Scenario: I edit project + + Scenario: I visit attachments diff --git a/features/project/snippets.feature b/features/project/snippets.feature new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/features/project/snippets.feature diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature new file mode 100644 index 0000000..04aebc1 --- /dev/null +++ b/features/project/source/browse_files.feature @@ -0,0 +1,23 @@ +Feature: Browse git repo + Background: + Given I signin as a user + And I own project "Shop" + Given I visit project source page + + Scenario: I browse files from master branch + Then I should see files from repository + + Scenario: I browse files for specific ref + Given I visit project source page for "8470d70" + Then I should see files from repository for "8470d70" + + Scenario: I browse file content + Given I click on file from repo + Then I should see it content + + Scenario: I browse raw file + Given I visit blob file from repo + And I click on raw button + Then I should see raw file content + + diff --git a/features/project/source/git_blame.feature b/features/project/source/git_blame.feature new file mode 100644 index 0000000..6aa6be4 --- /dev/null +++ b/features/project/source/git_blame.feature @@ -0,0 +1,10 @@ +Feature: Browse git repo + Background: + Given I signin as a user + And I own project "Shop" + Given I visit project source page + + Scenario: I blame file + Given I click on file from repo + And I click blame button + Then I should see git file blame diff --git a/features/project/team_management.feature b/features/project/team_management.feature new file mode 100644 index 0000000..b5b485e --- /dev/null +++ b/features/project/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/project/wall.feature b/features/project/wall.feature new file mode 100644 index 0000000..ed675e2 --- /dev/null +++ b/features/project/wall.feature @@ -0,0 +1,17 @@ +@javascript +Feature: Project Wall + In order to use Project Wall + A user + Should be able to read & write messages + + Background: + Given I signin as a user + And I own project "Shop" + And I visit project "Shop" wall page + + Scenario: Write comment + Given I write new comment "my special test message" + Then I should see project wall note "my special test message" + + Then I visit project "Shop" wall page + And I should see project wall note "my special test message" diff --git a/features/project/web_hooks.feature b/features/project/web_hooks.feature new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/features/project/web_hooks.feature diff --git a/features/project/wiki.feature b/features/project/wiki.feature new file mode 100644 index 0000000..4441ada --- /dev/null +++ b/features/project/wiki.feature @@ -0,0 +1,15 @@ +Feature: Wiki + Background: + Given I signin as a user + And I own project "Shop" + Given I visit project wiki page + + Scenario: Add new page + Given I create Wiki page + Then I should see newly created wiki page + + @javascript + Scenario: I comment wiki page + Given I create Wiki page + And I leave a comment like "XML attached" + Then I should see comment "XML attached" diff --git a/features/projects/commits/branches.feature b/features/projects/commits/branches.feature deleted file mode 100644 index 74575c5..0000000 --- a/features/projects/commits/branches.feature +++ /dev/null @@ -1,23 +0,0 @@ -Feature: Browse branches - Background: - Given I signin as a user - And I own project "Shop" - And project "Shop" has protected branches - Given I visit project branches page - - Scenario: I can see project recent git branches - Then I should see "Shop" recent branches list - - Scenario: I can see project all git branches - Given I click link "All" - Then I should see "Shop" all branches list - - Scenario: I can see project protected git branches - Given I click link "Protected" - Then I should see "Shop" protected branches list - - Scenario: I can download project by branch - - Scenario: I can view protected branches - - Scenario: I can manage protected branches diff --git a/features/projects/commits/commit_comments.feature b/features/projects/commits/commit_comments.feature deleted file mode 100644 index 9bd56d2..0000000 --- a/features/projects/commits/commit_comments.feature +++ /dev/null @@ -1,10 +0,0 @@ -Feature: Comment commit - Background: - Given I signin as a user - And I own project "Shop" - Given I visit project commit page - - @javascript - Scenario: I comment commit - Given I leave a comment like "XML attached" - Then I should see comment "XML attached" diff --git a/features/projects/commits/commits.feature b/features/projects/commits/commits.feature deleted file mode 100644 index 69d39d7..0000000 --- a/features/projects/commits/commits.feature +++ /dev/null @@ -1,22 +0,0 @@ -Feature: Browse commits - Background: - Given I signin as a user - And I own project "Shop" - Given I visit project commits page - - Scenario: I browse commits list for master branch - Then I see project commits - - Scenario: I browse atom feed of commits list for master branch - Given I click atom feed link - Then I see commits atom feed - - Scenario: I browse commit from list - Given I click on commit link - Then I see commit info - - Scenario: I compare refs - Given I visit compare refs page - And I fill compare fields with refs - And I see compared refs - diff --git a/features/projects/commits/tags.feature b/features/projects/commits/tags.feature deleted file mode 100644 index f7899fc..0000000 --- a/features/projects/commits/tags.feature +++ /dev/null @@ -1,10 +0,0 @@ -Feature: Browse tags - Background: - Given I signin as a user - And I own project "Shop" - Given I visit project tags page - - Scenario: I can see all git tags - Then I should see "Shop" all tags list - - Scenario: I can download project by tag diff --git a/features/projects/create_project.feature b/features/projects/create_project.feature deleted file mode 100644 index 42d25b3..0000000 --- a/features/projects/create_project.feature +++ /dev/null @@ -1,11 +0,0 @@ -Feature: Create Project - In order to get access to project sections - A user with ability to create a project - Should be able to create a new one - - Scenario: User create a project - Given I signin as a user - When I visit new project page - And fill project form with valid data - Then I should see project page - And I should see empty project instuctions diff --git a/features/projects/deploy_keys.feature b/features/projects/deploy_keys.feature deleted file mode 100644 index e69de29..0000000 --- a/features/projects/deploy_keys.feature +++ /dev/null diff --git a/features/projects/issues/issues.feature b/features/projects/issues/issues.feature deleted file mode 100644 index b2301b3..0000000 --- a/features/projects/issues/issues.feature +++ /dev/null @@ -1,82 +0,0 @@ -Feature: Issues - Background: - Given I signin as a user - And I own project "Shop" - And project "Shop" have "Release 0.4" open issue - And project "Shop" have "Release 0.3" closed issue - And I visit project "Shop" issues page - - Scenario: I should see open issues - Given I should see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - - Scenario: I should see closed issues - Given I click link "Closed" - Then I should see "Release 0.3" in issues - And I should not see "Release 0.4" in issues - - Scenario: I should see all issues - Given I click link "All" - Then I should see "Release 0.3" in issues - And I should see "Release 0.4" in issues - - Scenario: I visit issue page - Given I click link "Release 0.4" - Then I should see issue "Release 0.4" - - @javascript - Scenario: I submit new unassigned issue - Given I click link "New Issue" - And I submit new issue "500 error on profile" - Given I click link "500 error on profile" - Then I should see issue "500 error on profile" - - @javascript - Scenario: I comment issue - Given I visit issue page "Release 0.4" - And I leave a comment like "XML attached" - Then I should see comment "XML attached" - - @javascript - Scenario: I search issue - Given I fill in issue search with "Release" - Then I should see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - - @javascript - Scenario: I search issue that not exist - Given I fill in issue search with "Bug" - Then I should not see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - - - @javascript - Scenario: I search all issues - Given I click link "All" - And I fill in issue search with "0.3" - Then I should see "Release 0.3" in issues - And I should not see "Release 0.4" in issues - - @javascript - Scenario: I clear search - Given I click link "All" - And I fill in issue search with "Something" - And I fill in issue search with "" - Then I should see "Release 0.4" in issues - And I should see "Release 0.3" in issues - - @javascript - Scenario: I create Issue with pre-selected milestone - Given project "Shop" has milestone "v2.2" - And project "Shop" has milestone "v3.0" - And I visit project "Shop" issues page - When I select milestone "v3.0" - And I click link "New Issue" - Then I should see selected milestone with title "v3.0" - - @javascript - Scenario: I create Issue with pre-selected assignee - When I select first assignee from "Shop" project - And I click link "New Issue" - Then I should see first assignee from "Shop" as selected assignee - diff --git a/features/projects/issues/labels.feature b/features/projects/issues/labels.feature deleted file mode 100644 index 5a20bfd..0000000 --- a/features/projects/issues/labels.feature +++ /dev/null @@ -1,13 +0,0 @@ -Feature: Labels - Background: - Given I signin as a user - And I own project "Shop" - And project "Shop" have issues tags: - | name | - | bug | - | feature | - Given I visit project "Shop" labels page - - Scenario: I should see active milestones - Then I should see label "bug" - And I should see label "feature" diff --git a/features/projects/issues/milestones.feature b/features/projects/issues/milestones.feature deleted file mode 100644 index d78096a..0000000 --- a/features/projects/issues/milestones.feature +++ /dev/null @@ -1,18 +0,0 @@ -Feature: Milestones - Background: - Given I signin as a user - And I own project "Shop" - And project "Shop" has milestone "v2.2" - Given I visit project "Shop" milestones page - - Scenario: I should see active milestones - Then I should see milestone "v2.2" - - Scenario: I should see milestone - Given I click link "v2.2" - Then I should see milestone "v2.2" - - Scenario: I create new milestone - Given I click link "New Milestone" - And I submit new milestone "v2.3" - Then I should see milestone "v2.3" diff --git a/features/projects/merge_requests.feature b/features/projects/merge_requests.feature deleted file mode 100644 index 54b6ccd..0000000 --- a/features/projects/merge_requests.feature +++ /dev/null @@ -1,42 +0,0 @@ -Feature: Merge Requests - Background: - Given I signin as a user - And I own project "Shop" - And project "Shop" have "Bug NS-04" open merge request - And project "Shop" have "Feature NS-03" closed merge request - And I visit project "Shop" merge requests page - - Scenario: I should see open merge requests - Then I should see "Bug NS-04" in merge requests - And I should not see "Feature NS-03" in merge requests - - Scenario: I should see closed merge requests - Given I click link "Closed" - Then I should see "Feature NS-03" in merge requests - And I should not see "Bug NS-04" in merge requests - - Scenario: I should see all merge requests - Given I click link "All" - Then I should see "Feature NS-03" in merge requests - And I should see "Bug NS-04" in merge requests - - Scenario: I visit merge request page - Given I click link "Bug NS-04" - Then I should see merge request "Bug NS-04" - - Scenario: I close merge request page - Given I click link "Bug NS-04" - And I click link "Close" - Then I should see closed merge request "Bug NS-04" - - Scenario: I submit new unassigned merge request - Given I click link "New Merge Request" - And I submit new merge request "Wiki Feature" - Then I should see merge request "Wiki Feature" - - @javascript - Scenario: I comment merge request - Given I visit merge request page "Bug NS-04" - And I leave a comment like "XML attached" - Then I should see comment "XML attached" - diff --git a/features/projects/network.feature b/features/projects/network.feature deleted file mode 100644 index 61c05eb..0000000 --- a/features/projects/network.feature +++ /dev/null @@ -1,10 +0,0 @@ -@javascript -Feature: Project Network Graph - - Background: - Given I signin as a user - And I own project "Shop" - And I visit project "Shop" network page - - Scenario: I should see project network - Then page should have network graph diff --git a/features/projects/project.feature b/features/projects/project.feature deleted file mode 100644 index 895a928..0000000 --- a/features/projects/project.feature +++ /dev/null @@ -1,11 +0,0 @@ -Feature: Project - Background: - Given I signin as a user - And I own project "Shop" - And I visit project "Shop" page - - Scenario: I should see project activity - - Scenario: I edit project - - Scenario: I visit attachments diff --git a/features/projects/snippets.feature b/features/projects/snippets.feature deleted file mode 100644 index e69de29..0000000 --- a/features/projects/snippets.feature +++ /dev/null diff --git a/features/projects/source/browse_files.feature b/features/projects/source/browse_files.feature deleted file mode 100644 index 04aebc1..0000000 --- a/features/projects/source/browse_files.feature +++ /dev/null @@ -1,23 +0,0 @@ -Feature: Browse git repo - Background: - Given I signin as a user - And I own project "Shop" - Given I visit project source page - - Scenario: I browse files from master branch - Then I should see files from repository - - Scenario: I browse files for specific ref - Given I visit project source page for "8470d70" - Then I should see files from repository for "8470d70" - - Scenario: I browse file content - Given I click on file from repo - Then I should see it content - - Scenario: I browse raw file - Given I visit blob file from repo - And I click on raw button - Then I should see raw file content - - diff --git a/features/projects/source/git_blame.feature b/features/projects/source/git_blame.feature deleted file mode 100644 index 6aa6be4..0000000 --- a/features/projects/source/git_blame.feature +++ /dev/null @@ -1,10 +0,0 @@ -Feature: Browse git repo - Background: - Given I signin as a user - And I own project "Shop" - Given I visit project source page - - Scenario: I blame file - Given I click on file from repo - And I click blame button - Then I should see git file blame diff --git a/features/projects/team_management.feature b/features/projects/team_management.feature deleted file mode 100644 index b5b485e..0000000 --- a/features/projects/team_management.feature +++ /dev/null @@ -1,35 +0,0 @@ -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/projects/wall.feature b/features/projects/wall.feature deleted file mode 100644 index ed675e2..0000000 --- a/features/projects/wall.feature +++ /dev/null @@ -1,17 +0,0 @@ -@javascript -Feature: Project Wall - In order to use Project Wall - A user - Should be able to read & write messages - - Background: - Given I signin as a user - And I own project "Shop" - And I visit project "Shop" wall page - - Scenario: Write comment - Given I write new comment "my special test message" - Then I should see project wall note "my special test message" - - Then I visit project "Shop" wall page - And I should see project wall note "my special test message" diff --git a/features/projects/web_hooks.feature b/features/projects/web_hooks.feature deleted file mode 100644 index e69de29..0000000 --- a/features/projects/web_hooks.feature +++ /dev/null diff --git a/features/projects/wiki.feature b/features/projects/wiki.feature deleted file mode 100644 index 4441ada..0000000 --- a/features/projects/wiki.feature +++ /dev/null @@ -1,15 +0,0 @@ -Feature: Wiki - Background: - Given I signin as a user - And I own project "Shop" - Given I visit project wiki page - - Scenario: Add new page - Given I create Wiki page - Then I should see newly created wiki page - - @javascript - Scenario: I comment wiki page - Given I create Wiki page - And I leave a comment like "XML attached" - Then I should see comment "XML attached" diff --git a/features/steps/project_browse_branches.rb b/features/steps/project_browse_branches.rb new file mode 100644 index 0000000..9fb2e59 --- /dev/null +++ b/features/steps/project_browse_branches.rb @@ -0,0 +1,44 @@ +class ProjectBrowseBranches < Spinach::FeatureSteps + Then 'I should see "Shop" recent branches list' do + page.should have_content "Branches" + page.should have_content "master" + end + + Given 'I click link "All"' do + click_link "All" + end + + Then 'I should see "Shop" all branches list' do + page.should have_content "Branches" + page.should have_content "master" + end + + Given 'I click link "Protected"' do + click_link "Protected" + end + + Then 'I should see "Shop" protected branches list' do + within "table" do + page.should have_content "stable" + page.should_not have_content "master" + end + end + + Given 'I sign in as a user' do + login_as :user + end + + And 'I own project "Shop"' do + @project = Factory :project, :name => "Shop" + @project.add_access(@user, :admin) + end + + And 'project "Shop" has protected branches' do + project = Project.find_by_name("Shop") + project.protected_branches.create(:name => "stable") + end + + Given 'I visit project branches page' do + visit branches_project_repository_path(@project) + end +end diff --git a/features/steps/project_browse_commits.rb b/features/steps/project_browse_commits.rb new file mode 100644 index 0000000..71c592a --- /dev/null +++ b/features/steps/project_browse_commits.rb @@ -0,0 +1,60 @@ +class ProjectBrowseCommits < Spinach::FeatureSteps + 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 = CommitDecorator.decorate(@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.description) + 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 + + And 'I fill compare fields with refs' do + fill_in "from", :with => "master" + fill_in "to", :with => "stable" + click_button "Compare" + end + + And '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 sign in as a user' do + login_as :user + end + + And 'I own project "Shop"' do + @project = Factory :project, :name => "Shop" + @project.add_access(@user, :admin) + end + + Given 'I visit project commits page' do + visit project_commits_path(@project) + end +end diff --git a/features/steps/project_browse_tags.rb b/features/steps/project_browse_tags.rb new file mode 100644 index 0000000..c6bea69 --- /dev/null +++ b/features/steps/project_browse_tags.rb @@ -0,0 +1,19 @@ +class ProjectBrowseTags < Spinach::FeatureSteps + Then 'I should see "Shop" all tags list' do + page.should have_content "Tags" + page.should have_content "v1.2.1" + end + + Given 'I sign in as a user' do + login_as :user + end + + And 'I own project "Shop"' do + @project = Factory :project, :name => "Shop" + @project.add_access(@user, :admin) + end + + Given 'I visit project tags page' do + visit tags_project_repository_path(@project) + end +end diff --git a/features/steps/project_comment_commit.rb b/features/steps/project_comment_commit.rb new file mode 100644 index 0000000..04e94c7 --- /dev/null +++ b/features/steps/project_comment_commit.rb @@ -0,0 +1,23 @@ +class ProjectCommentCommit < Spinach::FeatureSteps + Given 'I leave a comment like "XML attached"' do + fill_in "note_note", :with => "XML attached" + click_button "Add Comment" + end + + Then 'I should see comment "XML attached"' do + page.should have_content "XML attached" + end + + Given 'I sign in as a user' do + login_as :user + end + + And 'I own project "Shop"' do + @project = Factory :project, :name => "Shop" + @project.add_access(@user, :admin) + end + + Given 'I visit project commit page' do + visit project_commit_path(@project, ValidCommit::ID) + end +end diff --git a/features/support/env.rb b/features/support/env.rb index 2900e1c..38d828a 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -4,12 +4,21 @@ require './config/environment' require 'rspec' require 'database_cleaner' -%w(login_helpers stubbed_repository).each do |f| +%w(gitolite_stub login_helpers stubbed_repository valid_commit).each do |f| require Rails.root.join('spec', 'support', f) end include LoginHelpers +include GitoliteStub -DatabaseCleaner.strategy = :transaction +WebMock.allow_net_connect! + +DatabaseCleaner.strategy = :truncation Spinach.hooks.before_scenario { DatabaseCleaner.start } Spinach.hooks.after_scenario { DatabaseCleaner.clean } + +Spinach.hooks.before_run do + RSpec::Mocks::setup self + + stub_gitolite! +end -- libgit2 0.21.2