Commit 3f01ec2d5b7421f05192fc78974a7ff4ba8c8daf
Exists in
master
and in
4 other branches
Merge pull request #1426 from NARKOZ/spinach
Cucumber => Spinach
Showing
89 changed files
with
1398 additions
and
1263 deletions
Show diff stats
Gemfile
... | ... | @@ -106,6 +106,7 @@ group :development do |
106 | 106 | end |
107 | 107 | |
108 | 108 | group :development, :test do |
109 | + gem 'spinach-rails' | |
109 | 110 | gem "rspec-rails" |
110 | 111 | gem "capybara" |
111 | 112 | gem "capybara-webkit" |
... | ... | @@ -118,7 +119,7 @@ group :development, :test do |
118 | 119 | |
119 | 120 | # Guard |
120 | 121 | gem 'guard-rspec' |
121 | - gem 'guard-cucumber' | |
122 | + gem 'guard-spinach' | |
122 | 123 | |
123 | 124 | # Notification |
124 | 125 | gem 'rb-fsevent', :require => darwin_only('rb-fsevent') |
... | ... | @@ -127,7 +128,6 @@ group :development, :test do |
127 | 128 | end |
128 | 129 | |
129 | 130 | group :test do |
130 | - gem 'cucumber-rails', :require => false | |
131 | 131 | gem "simplecov", :require => false |
132 | 132 | gem "shoulda-matchers" |
133 | 133 | gem 'email_spec' | ... | ... |
Gemfile.lock
... | ... | @@ -132,16 +132,8 @@ GEM |
132 | 132 | execjs |
133 | 133 | coffee-script-source (1.3.3) |
134 | 134 | colored (1.2) |
135 | + colorize (0.5.8) | |
135 | 136 | crack (0.3.1) |
136 | - cucumber (1.2.1) | |
137 | - builder (>= 2.1.2) | |
138 | - diff-lcs (>= 1.1.3) | |
139 | - gherkin (~> 2.11.0) | |
140 | - json (>= 1.4.6) | |
141 | - cucumber-rails (1.3.0) | |
142 | - capybara (>= 1.1.2) | |
143 | - cucumber (>= 1.1.8) | |
144 | - nokogiri (>= 1.5.0) | |
145 | 137 | daemons (1.1.8) |
146 | 138 | database_cleaner (0.8.0) |
147 | 139 | devise (2.1.2) |
... | ... | @@ -170,8 +162,7 @@ GEM |
170 | 162 | ffi (1.0.11) |
171 | 163 | foreman (0.47.0) |
172 | 164 | thor (>= 0.13.6) |
173 | - gherkin (2.11.0) | |
174 | - json (>= 1.4.6) | |
165 | + gherkin-ruby (0.2.1) | |
175 | 166 | git (1.2.5) |
176 | 167 | github-markup (0.7.4) |
177 | 168 | gitlab_meta (2.9) |
... | ... | @@ -185,11 +176,11 @@ GEM |
185 | 176 | guard (1.3.2) |
186 | 177 | listen (>= 0.4.2) |
187 | 178 | thor (>= 0.14.6) |
188 | - guard-cucumber (1.2.0) | |
189 | - cucumber (>= 1.2.0) | |
190 | - guard (>= 1.1.0) | |
191 | 179 | guard-rspec (1.2.1) |
192 | 180 | guard (>= 1.1) |
181 | + guard-spinach (0.0.2) | |
182 | + guard (>= 1.1) | |
183 | + spinach | |
193 | 184 | haml (3.1.6) |
194 | 185 | haml-rails (0.3.4) |
195 | 186 | actionpack (~> 3.0) |
... | ... | @@ -344,6 +335,13 @@ GEM |
344 | 335 | tilt (~> 1.3, >= 1.3.3) |
345 | 336 | six (0.2.0) |
346 | 337 | slop (2.4.4) |
338 | + spinach (0.5.2) | |
339 | + colorize | |
340 | + gherkin-ruby (~> 0.2.0) | |
341 | + spinach-rails (0.1.8) | |
342 | + capybara (~> 1) | |
343 | + railties (>= 3) | |
344 | + spinach (>= 0.4) | |
347 | 345 | sprockets (2.1.3) |
348 | 346 | hike (~> 1.2) |
349 | 347 | rack (~> 1.0) |
... | ... | @@ -394,7 +392,6 @@ DEPENDENCIES |
394 | 392 | chosen-rails |
395 | 393 | coffee-rails (= 3.2.2) |
396 | 394 | colored |
397 | - cucumber-rails | |
398 | 395 | database_cleaner |
399 | 396 | devise (~> 2.1.0) |
400 | 397 | draper |
... | ... | @@ -410,8 +407,8 @@ DEPENDENCIES |
410 | 407 | grape (~> 0.2.1) |
411 | 408 | grit! |
412 | 409 | growl |
413 | - guard-cucumber | |
414 | 410 | guard-rspec |
411 | + guard-spinach | |
415 | 412 | haml-rails |
416 | 413 | headless |
417 | 414 | httparty |
... | ... | @@ -442,6 +439,7 @@ DEPENDENCIES |
442 | 439 | shoulda-matchers |
443 | 440 | simplecov |
444 | 441 | six |
442 | + spinach-rails | |
445 | 443 | sqlite3 |
446 | 444 | stamp |
447 | 445 | therubyracer | ... | ... |
Guardfile
... | ... | @@ -13,18 +13,14 @@ guard 'rspec', :version => 2 do |
13 | 13 | watch(%r{^spec/support/(.+)\.rb$}) { "spec" } |
14 | 14 | watch('config/routes.rb') { "spec/routing" } |
15 | 15 | watch('app/controllers/application_controller.rb') { "spec/controllers" } |
16 | - | |
16 | + | |
17 | 17 | # Capybara request specs |
18 | 18 | watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" } |
19 | - | |
20 | - # Turnip features and steps | |
21 | - watch(%r{^spec/acceptance/(.+)\.feature$}) | |
22 | - watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } | |
23 | 19 | end |
24 | 20 | |
25 | - | |
26 | -guard 'cucumber' do | |
27 | - watch(%r{^features/.+\.feature$}) | |
28 | - watch(%r{^features/support/.+$}) { 'features' } | |
29 | - watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' } | |
21 | +guard 'spinach' do | |
22 | + watch(%r|^features/(.*)\.feature|) | |
23 | + watch(%r|^features/steps/(.*)([^/]+)\.rb|) do |m| | |
24 | + "features/#{m[1]}#{m[2]}.feature" | |
25 | + end | |
30 | 26 | end | ... | ... |
config/cucumber.yml
... | ... | @@ -1,8 +0,0 @@ |
1 | -<% | |
2 | -rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" | |
3 | -rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" | |
4 | -std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip" | |
5 | -%> | |
6 | -default: <%= std_opts %> features | |
7 | -wip: --tags @wip:3 --wip features | |
8 | -rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip |
features/dashboard/dashboard.feature
1 | 1 | Feature: Dashboard |
2 | - Background: | |
3 | - Given I signin as a user | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | 4 | And I own project "Shop" |
5 | 5 | And project "Shop" has push event |
6 | - And I visit dashboard page | |
6 | + And I visit dashboard page | |
7 | 7 | |
8 | 8 | Scenario: I should see projects list |
9 | 9 | Then I should see "New Project" link |
... | ... | @@ -25,4 +25,3 @@ Feature: Dashboard |
25 | 25 | And user with name "John Doe" left project "Shop" |
26 | 26 | When I visit dashboard page |
27 | 27 | Then I should see "John Doe left project Shop" event |
28 | - | ... | ... |
features/dashboard/issues.feature
1 | 1 | Feature: Dashboard Issues |
2 | - Background: | |
3 | - Given I signin as a user | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | 4 | And I have assigned issues |
5 | - And I visit dashboard issues page | |
5 | + And I visit dashboard issues page | |
6 | 6 | |
7 | 7 | Scenario: I should see issues list |
8 | 8 | Then I should see issues assigned to me | ... | ... |
features/dashboard/merge_requests.feature
1 | -Feature: Dashboard MR | |
2 | - Background: | |
3 | - Given I signin as a user | |
1 | +Feature: Dashboard Merge Requests | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | 4 | And I have authored merge requests |
5 | - And I visit dashboard merge requests page | |
5 | + And I visit dashboard merge requests page | |
6 | 6 | |
7 | 7 | Scenario: I should see projects list |
8 | 8 | Then I should see my merge requests | ... | ... |
features/dashboard/search.feature
1 | 1 | Feature: Dashboard Search |
2 | - Background: | |
3 | - Given I signin as a user | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | 4 | And I own project "Shop" |
5 | - And I visit dashboard search page | |
5 | + And I visit dashboard search page | |
6 | 6 | |
7 | - Scenario: I should see project i'm looking for | |
7 | + Scenario: I should see project I am looking for | |
8 | 8 | Given I search for "Sho" |
9 | 9 | Then I should see "Shop" project link |
10 | - | |
11 | - | ... | ... |
features/profile/profile.feature
features/profile/ssh_keys.feature
1 | -Feature: SSH Keys | |
2 | - Background: | |
3 | - Given I signin as a user | |
4 | - And I have ssh keys: | |
5 | - | title | | |
6 | - | ssh-rsa Work | | |
7 | - | ssh-rsa Home | | |
1 | +Feature: Profile SSH Keys | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I have ssh key "ssh-rsa Work" | |
8 | 5 | And I visit profile keys page |
9 | 6 | |
10 | - Scenario: I should see SSH keys | |
7 | + Scenario: I should see ssh keys | |
11 | 8 | Then I should see my ssh keys |
12 | 9 | |
13 | 10 | Scenario: Add new ssh key | ... | ... |
... | ... | @@ -0,0 +1,26 @@ |
1 | +Feature: Project Browse branches | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + And project "Shop" has protected branches | |
6 | + Given I visit project branches page | |
7 | + | |
8 | + Scenario: I can see project recent git branches | |
9 | + Then I should see "Shop" recent branches list | |
10 | + | |
11 | + Scenario: I can see project all git branches | |
12 | + Given I click link "All" | |
13 | + Then I should see "Shop" all branches list | |
14 | + | |
15 | + Scenario: I can see project protected git branches | |
16 | + Given I click link "Protected" | |
17 | + Then I should see "Shop" protected branches list | |
18 | + | |
19 | + # @wip | |
20 | + # Scenario: I can download project by branch | |
21 | + | |
22 | + # @wip | |
23 | + # Scenario: I can view protected branches | |
24 | + | |
25 | + # @wip | |
26 | + # Scenario: I can manage protected branches | ... | ... |
... | ... | @@ -0,0 +1,10 @@ |
1 | +Feature: Project Comment commit | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + Given I visit project commit page | |
6 | + | |
7 | + @javascript | |
8 | + Scenario: I comment commit | |
9 | + Given I leave a comment like "XML attached" | |
10 | + Then I should see comment "XML attached" | ... | ... |
... | ... | @@ -0,0 +1,21 @@ |
1 | +Feature: Project Browse commits | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + Given I visit project commits page | |
6 | + | |
7 | + Scenario: I browse commits list for master branch | |
8 | + Then I see project commits | |
9 | + | |
10 | + Scenario: I browse atom feed of commits list for master branch | |
11 | + Given I click atom feed link | |
12 | + Then I see commits atom feed | |
13 | + | |
14 | + Scenario: I browse commit from list | |
15 | + Given I click on commit link | |
16 | + Then I see commit info | |
17 | + | |
18 | + Scenario: I compare refs | |
19 | + Given I visit compare refs page | |
20 | + And I fill compare fields with refs | |
21 | + And I see compared refs | ... | ... |
... | ... | @@ -0,0 +1,11 @@ |
1 | +Feature: Project Browse tags | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + Given I visit project tags page | |
6 | + | |
7 | + Scenario: I can see all git tags | |
8 | + Then I should see "Shop" all tags list | |
9 | + | |
10 | + # @wip | |
11 | + # Scenario: I can download project by tag | ... | ... |
... | ... | @@ -0,0 +1,11 @@ |
1 | +Feature: Create Project | |
2 | + In order to get access to project sections | |
3 | + A user with ability to create a project | |
4 | + Should be able to create a new one | |
5 | + | |
6 | + Scenario: User create a project | |
7 | + Given I sign in as a user | |
8 | + When I visit new project page | |
9 | + And fill project form with valid data | |
10 | + Then I should see project page | |
11 | + And I should see empty project instuctions | ... | ... |
... | ... | @@ -0,0 +1,81 @@ |
1 | +Feature: Project Issues | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + And project "Shop" have "Release 0.4" open issue | |
6 | + And project "Shop" have "Release 0.3" closed issue | |
7 | + And I visit project "Shop" issues page | |
8 | + | |
9 | + Scenario: I should see open issues | |
10 | + Given I should see "Release 0.4" in issues | |
11 | + And I should not see "Release 0.3" in issues | |
12 | + | |
13 | + Scenario: I should see closed issues | |
14 | + Given I click link "Closed" | |
15 | + Then I should see "Release 0.3" in issues | |
16 | + And I should not see "Release 0.4" in issues | |
17 | + | |
18 | + Scenario: I should see all issues | |
19 | + Given I click link "All" | |
20 | + Then I should see "Release 0.3" in issues | |
21 | + And I should see "Release 0.4" in issues | |
22 | + | |
23 | + Scenario: I visit issue page | |
24 | + Given I click link "Release 0.4" | |
25 | + Then I should see issue "Release 0.4" | |
26 | + | |
27 | + @javascript | |
28 | + Scenario: I submit new unassigned issue | |
29 | + Given I click link "New Issue" | |
30 | + And I submit new issue "500 error on profile" | |
31 | + Given I click link "500 error on profile" | |
32 | + Then I should see issue "500 error on profile" | |
33 | + | |
34 | + @javascript | |
35 | + Scenario: I comment issue | |
36 | + Given I visit issue page "Release 0.4" | |
37 | + And I leave a comment like "XML attached" | |
38 | + Then I should see comment "XML attached" | |
39 | + | |
40 | + @javascript | |
41 | + Scenario: I search issue | |
42 | + Given I fill in issue search with "Release" | |
43 | + Then I should see "Release 0.4" in issues | |
44 | + And I should not see "Release 0.3" in issues | |
45 | + | |
46 | + @javascript | |
47 | + Scenario: I search issue that not exist | |
48 | + Given I fill in issue search with "Bug" | |
49 | + Then I should not see "Release 0.4" in issues | |
50 | + And I should not see "Release 0.3" in issues | |
51 | + | |
52 | + | |
53 | + @javascript | |
54 | + Scenario: I search all issues | |
55 | + Given I click link "All" | |
56 | + And I fill in issue search with "0.3" | |
57 | + Then I should see "Release 0.3" in issues | |
58 | + And I should not see "Release 0.4" in issues | |
59 | + | |
60 | + @javascript | |
61 | + Scenario: I clear search | |
62 | + Given I click link "All" | |
63 | + And I fill in issue search with "Something" | |
64 | + And I fill in issue search with "" | |
65 | + Then I should see "Release 0.4" in issues | |
66 | + And I should see "Release 0.3" in issues | |
67 | + | |
68 | + @javascript | |
69 | + Scenario: I create Issue with pre-selected milestone | |
70 | + Given project "Shop" has milestone "v2.2" | |
71 | + And project "Shop" has milestone "v3.0" | |
72 | + And I visit project "Shop" issues page | |
73 | + When I select milestone "v3.0" | |
74 | + And I click link "New Issue" | |
75 | + Then I should see selected milestone with title "v3.0" | |
76 | + | |
77 | + @javascript | |
78 | + Scenario: I create Issue with pre-selected assignee | |
79 | + When I select first assignee from "Shop" project | |
80 | + And I click link "New Issue" | |
81 | + Then I should see first assignee from "Shop" as selected assignee | ... | ... |
... | ... | @@ -0,0 +1,10 @@ |
1 | +Feature: Project Labels | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + And project "Shop" have issues tags: "bug", "feature" | |
6 | + Given I visit project "Shop" labels page | |
7 | + | |
8 | + Scenario: I should see active milestones | |
9 | + Then I should see label "bug" | |
10 | + And I should see label "feature" | ... | ... |
... | ... | @@ -0,0 +1,18 @@ |
1 | +Feature: Project Milestones | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + And project "Shop" has milestone "v2.2" | |
6 | + Given I visit project "Shop" milestones page | |
7 | + | |
8 | + Scenario: I should see active milestones | |
9 | + Then I should see milestone "v2.2" | |
10 | + | |
11 | + Scenario: I should see milestone | |
12 | + Given I click link "v2.2" | |
13 | + Then I should see milestone "v2.2" | |
14 | + | |
15 | + Scenario: I create new milestone | |
16 | + Given I click link "New Milestone" | |
17 | + And I submit new milestone "v2.3" | |
18 | + Then I should see milestone "v2.3" | ... | ... |
... | ... | @@ -0,0 +1,42 @@ |
1 | +Feature: Project Merge Requests | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + And project "Shop" have "Bug NS-04" open merge request | |
6 | + And project "Shop" have "Feature NS-03" closed merge request | |
7 | + And I visit project "Shop" merge requests page | |
8 | + | |
9 | + Scenario: I should see open merge requests | |
10 | + Then I should see "Bug NS-04" in merge requests | |
11 | + And I should not see "Feature NS-03" in merge requests | |
12 | + | |
13 | + Scenario: I should see closed merge requests | |
14 | + Given I click link "Closed" | |
15 | + Then I should see "Feature NS-03" in merge requests | |
16 | + And I should not see "Bug NS-04" in merge requests | |
17 | + | |
18 | + Scenario: I should see all merge requests | |
19 | + Given I click link "All" | |
20 | + Then I should see "Feature NS-03" in merge requests | |
21 | + And I should see "Bug NS-04" in merge requests | |
22 | + | |
23 | + Scenario: I visit merge request page | |
24 | + Given I click link "Bug NS-04" | |
25 | + Then I should see merge request "Bug NS-04" | |
26 | + | |
27 | + Scenario: I close merge request page | |
28 | + Given I click link "Bug NS-04" | |
29 | + And I click link "Close" | |
30 | + Then I should see closed merge request "Bug NS-04" | |
31 | + | |
32 | + Scenario: I submit new unassigned merge request | |
33 | + Given I click link "New Merge Request" | |
34 | + And I submit new merge request "Wiki Feature" | |
35 | + Then I should see merge request "Wiki Feature" | |
36 | + | |
37 | + @javascript | |
38 | + Scenario: I comment merge request | |
39 | + Given I visit merge request page "Bug NS-04" | |
40 | + And I leave a comment like "XML attached" | |
41 | + Then I should see comment "XML attached" | |
42 | + | ... | ... |
... | ... | @@ -0,0 +1,14 @@ |
1 | +Feature: Projects | |
2 | + Background: | |
3 | + Given I signin as a user | |
4 | + And I own project "Shop" | |
5 | + And I visit project "Shop" page | |
6 | + | |
7 | + # @wip | |
8 | + # Scenario: I should see project activity | |
9 | + | |
10 | + # @wip | |
11 | + # Scenario: I edit project | |
12 | + | |
13 | + # @wip | |
14 | + # Scenario: I visit attachments | ... | ... |
... | ... | @@ -0,0 +1,21 @@ |
1 | +Feature: Project Browse files | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + Given I visit project source page | |
6 | + | |
7 | + Scenario: I browse files from master branch | |
8 | + Then I should see files from repository | |
9 | + | |
10 | + Scenario: I browse files for specific ref | |
11 | + Given I visit project source page for "8470d70" | |
12 | + Then I should see files from repository for "8470d70" | |
13 | + | |
14 | + Scenario: I browse file content | |
15 | + Given I click on "Gemfile" file in repo | |
16 | + Then I should see it content | |
17 | + | |
18 | + Scenario: I browse raw file | |
19 | + Given I visit blob file from repo | |
20 | + And I click link "raw" | |
21 | + Then I should see raw file content | ... | ... |
... | ... | @@ -0,0 +1,10 @@ |
1 | +Feature: Project Browse git repo | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + Given I visit project source page | |
6 | + | |
7 | + Scenario: I blame file | |
8 | + Given I click on "Gemfile" file in repo | |
9 | + And I click blame button | |
10 | + Then I should see git file blame | ... | ... |
... | ... | @@ -0,0 +1,34 @@ |
1 | +Feature: Project Team management | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + And gitlab user "Mike" | |
6 | + And gitlab user "Sam" | |
7 | + And "Sam" is "Shop" developer | |
8 | + And I visit project "Shop" team page | |
9 | + | |
10 | + Scenario: See all team members | |
11 | + Then I should be able to see myself in team | |
12 | + And I should see "Sam" in team list | |
13 | + | |
14 | + Scenario: Add user to project | |
15 | + Given I click link "New Team Member" | |
16 | + And I select "Mike" as "Reporter" | |
17 | + Then I should see "Mike" in team list as "Reporter" | |
18 | + | |
19 | + @javascript | |
20 | + Scenario: Update user access | |
21 | + Given I should see "Sam" in team list as "Developer" | |
22 | + And I change "Sam" role to "Reporter" | |
23 | + Then I visit project "Shop" team page | |
24 | + And I should see "Sam" in team list as "Reporter" | |
25 | + | |
26 | + Scenario: View team member profile | |
27 | + Given I click link "Sam" | |
28 | + Then I should see "Sam" team profile | |
29 | + | |
30 | + Scenario: Cancel team member | |
31 | + Given I click link "Sam" | |
32 | + And I click link "Remove from team" | |
33 | + Then I visit project "Shop" team page | |
34 | + And I should not see "Sam" in team list | ... | ... |
... | ... | @@ -0,0 +1,16 @@ |
1 | +Feature: Project Wall | |
2 | + In order to use Project Wall | |
3 | + A user should be able to read and write messages | |
4 | + | |
5 | + Background: | |
6 | + Given I sign in as a user | |
7 | + And I own project "Shop" | |
8 | + And I visit project "Shop" wall page | |
9 | + | |
10 | + @javascript | |
11 | + Scenario: Write comment | |
12 | + Given I write new comment "my special test message" | |
13 | + Then I should see project wall note "my special test message" | |
14 | + | |
15 | + Then I visit project "Shop" wall page | |
16 | + And I should see project wall note "my special test message" | ... | ... |
... | ... | @@ -0,0 +1,15 @@ |
1 | +Feature: Project Wiki | |
2 | + Background: | |
3 | + Given I sign in as a user | |
4 | + And I own project "Shop" | |
5 | + Given I visit project wiki page | |
6 | + | |
7 | + Scenario: Add new page | |
8 | + Given I create Wiki page | |
9 | + Then I should see newly created wiki page | |
10 | + | |
11 | + @javascript | |
12 | + Scenario: I comment wiki page | |
13 | + Given I create Wiki page | |
14 | + And I leave a comment like "XML attached" | |
15 | + Then I should see comment "XML attached" | ... | ... |
features/projects/commits/branches.feature
... | ... | @@ -1,23 +0,0 @@ |
1 | -Feature: Browse branches | |
2 | - Background: | |
3 | - Given I signin as a user | |
4 | - And I own project "Shop" | |
5 | - And project "Shop" has protected branches | |
6 | - Given I visit project branches page | |
7 | - | |
8 | - Scenario: I can see project recent git branches | |
9 | - Then I should see "Shop" recent branches list | |
10 | - | |
11 | - Scenario: I can see project all git branches | |
12 | - Given I click link "All" | |
13 | - Then I should see "Shop" all branches list | |
14 | - | |
15 | - Scenario: I can see project protected git branches | |
16 | - Given I click link "Protected" | |
17 | - Then I should see "Shop" protected branches list | |
18 | - | |
19 | - Scenario: I can download project by branch | |
20 | - | |
21 | - Scenario: I can view protected branches | |
22 | - | |
23 | - Scenario: I can manage protected branches |
features/projects/commits/commit_comments.feature
... | ... | @@ -1,10 +0,0 @@ |
1 | -Feature: Comment commit | |
2 | - Background: | |
3 | - Given I signin as a user | |
4 | - And I own project "Shop" | |
5 | - Given I visit project commit page | |
6 | - | |
7 | - @javascript | |
8 | - Scenario: I comment commit | |
9 | - Given I leave a comment like "XML attached" | |
10 | - Then I should see comment "XML attached" |
features/projects/commits/commits.feature
... | ... | @@ -1,22 +0,0 @@ |
1 | -Feature: Browse commits | |
2 | - Background: | |
3 | - Given I signin as a user | |
4 | - And I own project "Shop" | |
5 | - Given I visit project commits page | |
6 | - | |
7 | - Scenario: I browse commits list for master branch | |
8 | - Then I see project commits | |
9 | - | |
10 | - Scenario: I browse atom feed of commits list for master branch | |
11 | - Given I click atom feed link | |
12 | - Then I see commits atom feed | |
13 | - | |
14 | - Scenario: I browse commit from list | |
15 | - Given I click on commit link | |
16 | - Then I see commit info | |
17 | - | |
18 | - Scenario: I compare refs | |
19 | - Given I visit compare refs page | |
20 | - And I fill compare fields with refs | |
21 | - And I see compared refs | |
22 | - |
features/projects/commits/tags.feature
features/projects/create_project.feature
... | ... | @@ -1,11 +0,0 @@ |
1 | -Feature: Create Project | |
2 | - In order to get access to project sections | |
3 | - A user with ability to create a project | |
4 | - Should be able to create a new one | |
5 | - | |
6 | - Scenario: User create a project | |
7 | - Given I signin as a user | |
8 | - When I visit new project page | |
9 | - And fill project form with valid data | |
10 | - Then I should see project page | |
11 | - And I should see empty project instuctions |
features/projects/deploy_keys.feature
features/projects/issues/issues.feature
... | ... | @@ -1,82 +0,0 @@ |
1 | -Feature: Issues | |
2 | - Background: | |
3 | - Given I signin as a user | |
4 | - And I own project "Shop" | |
5 | - And project "Shop" have "Release 0.4" open issue | |
6 | - And project "Shop" have "Release 0.3" closed issue | |
7 | - And I visit project "Shop" issues page | |
8 | - | |
9 | - Scenario: I should see open issues | |
10 | - Given I should see "Release 0.4" in issues | |
11 | - And I should not see "Release 0.3" in issues | |
12 | - | |
13 | - Scenario: I should see closed issues | |
14 | - Given I click link "Closed" | |
15 | - Then I should see "Release 0.3" in issues | |
16 | - And I should not see "Release 0.4" in issues | |
17 | - | |
18 | - Scenario: I should see all issues | |
19 | - Given I click link "All" | |
20 | - Then I should see "Release 0.3" in issues | |
21 | - And I should see "Release 0.4" in issues | |
22 | - | |
23 | - Scenario: I visit issue page | |
24 | - Given I click link "Release 0.4" | |
25 | - Then I should see issue "Release 0.4" | |
26 | - | |
27 | - @javascript | |
28 | - Scenario: I submit new unassigned issue | |
29 | - Given I click link "New Issue" | |
30 | - And I submit new issue "500 error on profile" | |
31 | - Given I click link "500 error on profile" | |
32 | - Then I should see issue "500 error on profile" | |
33 | - | |
34 | - @javascript | |
35 | - Scenario: I comment issue | |
36 | - Given I visit issue page "Release 0.4" | |
37 | - And I leave a comment like "XML attached" | |
38 | - Then I should see comment "XML attached" | |
39 | - | |
40 | - @javascript | |
41 | - Scenario: I search issue | |
42 | - Given I fill in issue search with "Release" | |
43 | - Then I should see "Release 0.4" in issues | |
44 | - And I should not see "Release 0.3" in issues | |
45 | - | |
46 | - @javascript | |
47 | - Scenario: I search issue that not exist | |
48 | - Given I fill in issue search with "Bug" | |
49 | - Then I should not see "Release 0.4" in issues | |
50 | - And I should not see "Release 0.3" in issues | |
51 | - | |
52 | - | |
53 | - @javascript | |
54 | - Scenario: I search all issues | |
55 | - Given I click link "All" | |
56 | - And I fill in issue search with "0.3" | |
57 | - Then I should see "Release 0.3" in issues | |
58 | - And I should not see "Release 0.4" in issues | |
59 | - | |
60 | - @javascript | |
61 | - Scenario: I clear search | |
62 | - Given I click link "All" | |
63 | - And I fill in issue search with "Something" | |
64 | - And I fill in issue search with "" | |
65 | - Then I should see "Release 0.4" in issues | |
66 | - And I should see "Release 0.3" in issues | |
67 | - | |
68 | - @javascript | |
69 | - Scenario: I create Issue with pre-selected milestone | |
70 | - Given project "Shop" has milestone "v2.2" | |
71 | - And project "Shop" has milestone "v3.0" | |
72 | - And I visit project "Shop" issues page | |
73 | - When I select milestone "v3.0" | |
74 | - And I click link "New Issue" | |
75 | - Then I should see selected milestone with title "v3.0" | |
76 | - | |
77 | - @javascript | |
78 | - Scenario: I create Issue with pre-selected assignee | |
79 | - When I select first assignee from "Shop" project | |
80 | - And I click link "New Issue" | |
81 | - Then I should see first assignee from "Shop" as selected assignee | |
82 | - |
features/projects/issues/labels.feature
... | ... | @@ -1,13 +0,0 @@ |
1 | -Feature: Labels | |
2 | - Background: | |
3 | - Given I signin as a user | |
4 | - And I own project "Shop" | |
5 | - And project "Shop" have issues tags: | |
6 | - | name | | |
7 | - | bug | | |
8 | - | feature | | |
9 | - Given I visit project "Shop" labels page | |
10 | - | |
11 | - Scenario: I should see active milestones | |
12 | - Then I should see label "bug" | |
13 | - And I should see label "feature" |
features/projects/issues/milestones.feature
... | ... | @@ -1,18 +0,0 @@ |
1 | -Feature: Milestones | |
2 | - Background: | |
3 | - Given I signin as a user | |
4 | - And I own project "Shop" | |
5 | - And project "Shop" has milestone "v2.2" | |
6 | - Given I visit project "Shop" milestones page | |
7 | - | |
8 | - Scenario: I should see active milestones | |
9 | - Then I should see milestone "v2.2" | |
10 | - | |
11 | - Scenario: I should see milestone | |
12 | - Given I click link "v2.2" | |
13 | - Then I should see milestone "v2.2" | |
14 | - | |
15 | - Scenario: I create new milestone | |
16 | - Given I click link "New Milestone" | |
17 | - And I submit new milestone "v2.3" | |
18 | - Then I should see milestone "v2.3" |
features/projects/merge_requests.feature
... | ... | @@ -1,42 +0,0 @@ |
1 | -Feature: Merge Requests | |
2 | - Background: | |
3 | - Given I signin as a user | |
4 | - And I own project "Shop" | |
5 | - And project "Shop" have "Bug NS-04" open merge request | |
6 | - And project "Shop" have "Feature NS-03" closed merge request | |
7 | - And I visit project "Shop" merge requests page | |
8 | - | |
9 | - Scenario: I should see open merge requests | |
10 | - Then I should see "Bug NS-04" in merge requests | |
11 | - And I should not see "Feature NS-03" in merge requests | |
12 | - | |
13 | - Scenario: I should see closed merge requests | |
14 | - Given I click link "Closed" | |
15 | - Then I should see "Feature NS-03" in merge requests | |
16 | - And I should not see "Bug NS-04" in merge requests | |
17 | - | |
18 | - Scenario: I should see all merge requests | |
19 | - Given I click link "All" | |
20 | - Then I should see "Feature NS-03" in merge requests | |
21 | - And I should see "Bug NS-04" in merge requests | |
22 | - | |
23 | - Scenario: I visit merge request page | |
24 | - Given I click link "Bug NS-04" | |
25 | - Then I should see merge request "Bug NS-04" | |
26 | - | |
27 | - Scenario: I close merge request page | |
28 | - Given I click link "Bug NS-04" | |
29 | - And I click link "Close" | |
30 | - Then I should see closed merge request "Bug NS-04" | |
31 | - | |
32 | - Scenario: I submit new unassigned merge request | |
33 | - Given I click link "New Merge Request" | |
34 | - And I submit new merge request "Wiki Feature" | |
35 | - Then I should see merge request "Wiki Feature" | |
36 | - | |
37 | - @javascript | |
38 | - Scenario: I comment merge request | |
39 | - Given I visit merge request page "Bug NS-04" | |
40 | - And I leave a comment like "XML attached" | |
41 | - Then I should see comment "XML attached" | |
42 | - |
features/projects/network.feature
features/projects/project.feature
features/projects/snippets.feature
features/projects/source/browse_files.feature
... | ... | @@ -1,23 +0,0 @@ |
1 | -Feature: Browse git repo | |
2 | - Background: | |
3 | - Given I signin as a user | |
4 | - And I own project "Shop" | |
5 | - Given I visit project source page | |
6 | - | |
7 | - Scenario: I browse files from master branch | |
8 | - Then I should see files from repository | |
9 | - | |
10 | - Scenario: I browse files for specific ref | |
11 | - Given I visit project source page for "8470d70" | |
12 | - Then I should see files from repository for "8470d70" | |
13 | - | |
14 | - Scenario: I browse file content | |
15 | - Given I click on file from repo | |
16 | - Then I should see it content | |
17 | - | |
18 | - Scenario: I browse raw file | |
19 | - Given I visit blob file from repo | |
20 | - And I click on raw button | |
21 | - Then I should see raw file content | |
22 | - | |
23 | - |
features/projects/source/git_blame.feature
features/projects/team_management.feature
... | ... | @@ -1,35 +0,0 @@ |
1 | -Feature: Project Team management | |
2 | - Background: | |
3 | - Given I signin as a user | |
4 | - And I own project "Shop" | |
5 | - And gitlab user "Mike" | |
6 | - And gitlab user "Sam" | |
7 | - And "Sam" is "Shop" developer | |
8 | - And I visit project "Shop" team page | |
9 | - | |
10 | - Scenario: See all team members | |
11 | - Then I should be able to see myself in team | |
12 | - And I should see "Sam" in team list | |
13 | - | |
14 | - Scenario: Add user to project | |
15 | - Given I click link "New Team Member" | |
16 | - And I select "Mike" as "Reporter" | |
17 | - Then I should see "Mike" in team list as "Reporter" | |
18 | - | |
19 | - @javascript | |
20 | - Scenario: Update user access | |
21 | - Given I should see "Sam" in team list as "Developer" | |
22 | - And I change "Sam" role to "Reporter" | |
23 | - Then I visit project "Shop" team page | |
24 | - And I should see "Sam" in team list as "Reporter" | |
25 | - | |
26 | - Scenario: View team member profile | |
27 | - Given I click link "Sam" | |
28 | - Then I should see "Sam" team profile | |
29 | - | |
30 | - Scenario: Cancel team member | |
31 | - Given I click link "Sam" | |
32 | - And I click link "Remove from team" | |
33 | - Then I visit project "Shop" team page | |
34 | - And I should not see "Sam" in team list | |
35 | - |
features/projects/wall.feature
... | ... | @@ -1,17 +0,0 @@ |
1 | -@javascript | |
2 | -Feature: Project Wall | |
3 | - In order to use Project Wall | |
4 | - A user | |
5 | - Should be able to read & write messages | |
6 | - | |
7 | - Background: | |
8 | - Given I signin as a user | |
9 | - And I own project "Shop" | |
10 | - And I visit project "Shop" wall page | |
11 | - | |
12 | - Scenario: Write comment | |
13 | - Given I write new comment "my special test message" | |
14 | - Then I should see project wall note "my special test message" | |
15 | - | |
16 | - Then I visit project "Shop" wall page | |
17 | - And I should see project wall note "my special test message" |
features/projects/web_hooks.feature
features/projects/wiki.feature
... | ... | @@ -1,15 +0,0 @@ |
1 | -Feature: Wiki | |
2 | - Background: | |
3 | - Given I signin as a user | |
4 | - And I own project "Shop" | |
5 | - Given I visit project wiki page | |
6 | - | |
7 | - Scenario: Add new page | |
8 | - Given I create Wiki page | |
9 | - Then I should see newly created wiki page | |
10 | - | |
11 | - @javascript | |
12 | - Scenario: I comment wiki page | |
13 | - Given I create Wiki page | |
14 | - And I leave a comment like "XML attached" | |
15 | - Then I should see comment "XML attached" |
features/step_definitions/common_steps.rb
... | ... | @@ -1,21 +0,0 @@ |
1 | -include LoginHelpers | |
2 | - | |
3 | -Given /^I signin as a user$/ do | |
4 | - login_as :user | |
5 | -end | |
6 | - | |
7 | -When /^I click link "(.*?)"$/ do |link| | |
8 | - click_link link | |
9 | -end | |
10 | - | |
11 | -When /^I click button "(.*?)"$/ do |button| | |
12 | - click_button button | |
13 | -end | |
14 | - | |
15 | -When /^I fill in "(.*?)" with "(.*?)"$/ do |field, value| | |
16 | - fill_in field, :with => value | |
17 | -end | |
18 | - | |
19 | -Given /^show me page$/ do | |
20 | - save_and_open_page | |
21 | -end |
features/step_definitions/dashboard_steps.rb
... | ... | @@ -1,136 +0,0 @@ |
1 | -Then /^I should see "(.*?)" link$/ do |arg1| | |
2 | - page.should have_link(arg1) | |
3 | -end | |
4 | - | |
5 | -Then /^I should see "(.*?)" project link$/ do |arg1| | |
6 | - page.should have_link(arg1) | |
7 | -end | |
8 | - | |
9 | -Then /^I should see project "(.*?)" activity feed$/ do |arg1| | |
10 | - project = Project.find_by_name(arg1) | |
11 | - page.should have_content "#{@user.name} pushed new branch new_design at #{project.name}" | |
12 | -end | |
13 | - | |
14 | -Given /^project "(.*?)" has push event$/ do |arg1| | |
15 | - @project = Project.find_by_name(arg1) | |
16 | - | |
17 | - data = { | |
18 | - :before => "0000000000000000000000000000000000000000", | |
19 | - :after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", | |
20 | - :ref => "refs/heads/new_design", | |
21 | - :user_id => @user.id, | |
22 | - :user_name => @user.name, | |
23 | - :repository => { | |
24 | - :name => @project.name, | |
25 | - :url => "localhost/rubinius", | |
26 | - :description => "", | |
27 | - :homepage => "localhost/rubinius", | |
28 | - :private => true | |
29 | - } | |
30 | - } | |
31 | - | |
32 | - @event = Event.create( | |
33 | - :project => @project, | |
34 | - :action => Event::Pushed, | |
35 | - :data => data, | |
36 | - :author_id => @user.id | |
37 | - ) | |
38 | -end | |
39 | - | |
40 | -Then /^I should see last push widget$/ do | |
41 | - page.should have_content "Your pushed to branch new_design" | |
42 | - page.should have_link "Create Merge Request" | |
43 | -end | |
44 | - | |
45 | -Then /^I click "(.*?)" link$/ do |arg1| | |
46 | - click_link arg1 #Create Merge Request" | |
47 | -end | |
48 | - | |
49 | -Then /^I see prefilled new Merge Request page$/ do | |
50 | - current_path.should == new_project_merge_request_path(@project) | |
51 | - find("#merge_request_source_branch").value.should == "new_design" | |
52 | - find("#merge_request_target_branch").value.should == "master" | |
53 | - find("#merge_request_title").value.should == "New Design" | |
54 | -end | |
55 | - | |
56 | -Given /^I visit dashboard search page$/ do | |
57 | - visit search_path | |
58 | -end | |
59 | - | |
60 | -Given /^I search for "(.*?)"$/ do |arg1| | |
61 | - fill_in "dashboard_search", :with => arg1 | |
62 | - click_button "Search" | |
63 | -end | |
64 | - | |
65 | -Then /^I should see issues assigned to me$/ do | |
66 | - issues = @user.issues | |
67 | - issues.each do |issue| | |
68 | - page.should have_content(issue.title[0..10]) | |
69 | - page.should have_content(issue.project.name) | |
70 | - end | |
71 | -end | |
72 | - | |
73 | -Then /^I should see my merge requests$/ do | |
74 | - merge_requests = @user.merge_requests | |
75 | - merge_requests.each do |mr| | |
76 | - page.should have_content(mr.title[0..10]) | |
77 | - page.should have_content(mr.project.name) | |
78 | - end | |
79 | -end | |
80 | - | |
81 | -Given /^I have assigned issues$/ do | |
82 | - project = Factory :project | |
83 | - project.add_access(@user, :read, :write) | |
84 | - | |
85 | - issue1 = Factory :issue, | |
86 | - :author => @user, | |
87 | - :assignee => @user, | |
88 | - :project => project | |
89 | - | |
90 | - issue2 = Factory :issue, | |
91 | - :author => @user, | |
92 | - :assignee => @user, | |
93 | - :project => project | |
94 | -end | |
95 | - | |
96 | -Given /^I have authored merge requests$/ do | |
97 | - project1 = Factory :project | |
98 | - | |
99 | - project2 = Factory :project | |
100 | - | |
101 | - project1.add_access(@user, :read, :write) | |
102 | - project2.add_access(@user, :read, :write) | |
103 | - | |
104 | - merge_request1 = Factory :merge_request, | |
105 | - :author => @user, | |
106 | - :project => project1 | |
107 | - | |
108 | - merge_request2 = Factory :merge_request, | |
109 | - :author => @user, | |
110 | - :project => project2 | |
111 | -end | |
112 | - | |
113 | -Given /^user with name "(.*?)" joined project "(.*?)"$/ do |user_name, project_name| | |
114 | - user = Factory.create(:user, {name: user_name}) | |
115 | - project = Project.find_by_name project_name | |
116 | - Event.create( | |
117 | - project: project, | |
118 | - author_id: user.id, | |
119 | - action: Event::Joined | |
120 | - ) | |
121 | -end | |
122 | - | |
123 | -Given /^user with name "(.*?)" left project "(.*?)"$/ do |user_name, project_name| | |
124 | - user = User.find_by_name user_name | |
125 | - project = Project.find_by_name project_name | |
126 | - Event.create( | |
127 | - project: project, | |
128 | - author_id: user.id, | |
129 | - action: Event::Left | |
130 | - ) | |
131 | -end | |
132 | - | |
133 | -Then /^I should see "(.*?)" event$/ do |event_text| | |
134 | - page.should have_content(event_text) | |
135 | -end | |
136 | - |
features/step_definitions/profile/profile_keys_steps.rb
... | ... | @@ -1,34 +0,0 @@ |
1 | -Given /^I visit profile keys page$/ do | |
2 | - visit keys_path | |
3 | -end | |
4 | - | |
5 | -Then /^I should see my ssh keys$/ do | |
6 | - @user.keys.each do |key| | |
7 | - page.should have_content(key.title) | |
8 | - end | |
9 | -end | |
10 | - | |
11 | -Given /^I have ssh keys:$/ do |table| | |
12 | - table.hashes.each do |row| | |
13 | - Factory :key, :user => @user, :title => row[:title], :key => "jfKLJDFKSFJSHFJ#{row[:title]}" | |
14 | - end | |
15 | -end | |
16 | - | |
17 | -Given /^I submit new ssh key "(.*?)"$/ do |arg1| | |
18 | - fill_in "key_title", :with => arg1 | |
19 | - fill_in "key_key", :with => "ssh-rsa publickey234=" | |
20 | - click_button "Save" | |
21 | -end | |
22 | - | |
23 | -Then /^I should see new ssh key "(.*?)"$/ do |arg1| | |
24 | - key = Key.find_by_title(arg1) | |
25 | - page.should have_content(key.title) | |
26 | - page.should have_content(key.key) | |
27 | - current_path.should == key_path(key) | |
28 | -end | |
29 | - | |
30 | -Then /^I should not see "(.*?)" ssh key$/ do |arg1| | |
31 | - within "#keys-table" do | |
32 | - page.should_not have_content(arg1) | |
33 | - end | |
34 | -end |
features/step_definitions/profile/profile_steps.rb
... | ... | @@ -1,39 +0,0 @@ |
1 | -Then /^I should see my profile info$/ do | |
2 | - page.should have_content "Profile" | |
3 | - page.should have_content @user.name | |
4 | - page.should have_content @user.email | |
5 | -end | |
6 | - | |
7 | -Then /^I change my password$/ do | |
8 | - fill_in "user_password", :with => "222333" | |
9 | - fill_in "user_password_confirmation", :with => "222333" | |
10 | - click_button "Save" | |
11 | -end | |
12 | - | |
13 | -Then /^I should be redirected to sign in page$/ do | |
14 | - current_path.should == new_user_session_path | |
15 | -end | |
16 | - | |
17 | -Then /^I reset my token$/ do | |
18 | - @old_token = @user.private_token | |
19 | - click_button "Reset" | |
20 | -end | |
21 | - | |
22 | -Then /^I should see new token$/ do | |
23 | - find("#token").value.should_not == @old_token | |
24 | - find("#token").value.should == @user.reload.private_token | |
25 | -end | |
26 | - | |
27 | -Then /^I change my contact info$/ do | |
28 | - fill_in "user_skype", :with => "testskype" | |
29 | - fill_in "user_linkedin", :with => "testlinkedin" | |
30 | - fill_in "user_twitter", :with => "testtwitter" | |
31 | - click_button "Save" | |
32 | - @user.reload | |
33 | -end | |
34 | - | |
35 | -Then /^I should see new contact info$/ do | |
36 | - @user.skype.should == 'testskype' | |
37 | - @user.linkedin.should == 'testlinkedin' | |
38 | - @user.twitter.should == 'testtwitter' | |
39 | -end |
features/step_definitions/project/browse_code_steps.rb
... | ... | @@ -1,38 +0,0 @@ |
1 | -Then /^I should see files from repository$/ do | |
2 | - page.should have_content("app") | |
3 | - page.should have_content("History") | |
4 | - page.should have_content("Gemfile") | |
5 | -end | |
6 | - | |
7 | -Then /^I should see files from repository for "(.*?)"$/ do |arg1| | |
8 | - current_path.should == tree_project_ref_path(@project, arg1) | |
9 | - page.should have_content("app") | |
10 | - page.should have_content("History") | |
11 | - page.should have_content("Gemfile") | |
12 | -end | |
13 | - | |
14 | -Given /^I click on file from repo$/ do | |
15 | - click_link "Gemfile" | |
16 | -end | |
17 | - | |
18 | -Then /^I should see it content$/ do | |
19 | - page.should have_content("rubygems.org") | |
20 | -end | |
21 | - | |
22 | -Given /^I click on raw button$/ do | |
23 | - click_link "raw" | |
24 | -end | |
25 | - | |
26 | -Then /^I should see raw file content$/ do | |
27 | - page.source.should == ValidCommit::BLOB_FILE | |
28 | -end | |
29 | - | |
30 | -Given /^I click blame button$/ do | |
31 | - click_link "blame" | |
32 | -end | |
33 | - | |
34 | -Then /^I should see git file blame$/ do | |
35 | - page.should have_content("rubygems.org") | |
36 | - page.should have_content("Dmitriy Zaporozhets") | |
37 | - page.should have_content("bc3735004cb Moving to rails 3.2") | |
38 | -end |
features/step_definitions/project/project_commits_steps.rb
... | ... | @@ -1,64 +0,0 @@ |
1 | -Then /^I see project commits$/ do | |
2 | - current_path.should == project_commits_path(@project) | |
3 | - | |
4 | - commit = @project.commit | |
5 | - page.should have_content(@project.name) | |
6 | - page.should have_content(commit.message) | |
7 | - page.should have_content(commit.id.to_s[0..5]) | |
8 | -end | |
9 | - | |
10 | -Given /^I click atom feed link$/ do | |
11 | - click_link "Feed" | |
12 | -end | |
13 | - | |
14 | -Then /^I see commits atom feed$/ do | |
15 | - commit = CommitDecorator.decorate(@project.commit) | |
16 | - page.response_headers['Content-Type'].should have_content("application/atom+xml") | |
17 | - page.body.should have_selector("title", :text => "Recent commits to #{@project.name}") | |
18 | - page.body.should have_selector("author email", :text => commit.author_email) | |
19 | - page.body.should have_selector("entry summary", :text => commit.description) | |
20 | -end | |
21 | - | |
22 | -Then /^I see commit info$/ do | |
23 | - page.should have_content ValidCommit::MESSAGE | |
24 | - page.should have_content "Showing 1 changed file" | |
25 | -end | |
26 | - | |
27 | -Given /^I fill compare fields with refs$/ do | |
28 | - fill_in "from", :with => "master" | |
29 | - fill_in "to", :with => "stable" | |
30 | - click_button "Compare" | |
31 | -end | |
32 | - | |
33 | -Given /^I see compared refs$/ do | |
34 | - page.should have_content "Commits (27)" | |
35 | - page.should have_content "Compare View" | |
36 | - page.should have_content "Showing 73 changed files" | |
37 | -end | |
38 | - | |
39 | -Then /^I should see "(.*?)" recent branches list$/ do |arg1| | |
40 | - page.should have_content("Branches") | |
41 | - page.should have_content("master") | |
42 | -end | |
43 | - | |
44 | -Then /^I should see "(.*?)" all branches list$/ do |arg1| | |
45 | - page.should have_content("Branches") | |
46 | - page.should have_content("master") | |
47 | -end | |
48 | - | |
49 | -Then /^I should see "(.*?)" all tags list$/ do |arg1| | |
50 | - page.should have_content("Tags") | |
51 | - page.should have_content("v1.2.1") | |
52 | -end | |
53 | - | |
54 | -Then /^I should see "(.*?)" protected branches list$/ do |arg1| | |
55 | - within "table" do | |
56 | - page.should have_content "stable" | |
57 | - page.should_not have_content "master" | |
58 | - end | |
59 | -end | |
60 | - | |
61 | -Given /^project "(.*?)" has protected branches$/ do |arg1| | |
62 | - project = Project.find_by_name(arg1) | |
63 | - project.protected_branches.create(:name => "stable") | |
64 | -end |
features/step_definitions/project/project_issues_steps.rb
... | ... | @@ -1,81 +0,0 @@ |
1 | -Given /^project "(.*?)" have "(.*?)" open issue$/ do |arg1, arg2| | |
2 | - project = Project.find_by_name(arg1) | |
3 | - Factory.create(:issue, :title => arg2, :project => project, :author => project.users.first) | |
4 | -end | |
5 | - | |
6 | -Given /^project "(.*?)" have "(.*?)" closed issue$/ do |arg1, arg2| | |
7 | - project = Project.find_by_name(arg1) | |
8 | - Factory.create(:issue, :title => arg2, :project => project, :author => project.users.first, :closed => true) | |
9 | -end | |
10 | - | |
11 | -Given /^I should see "(.*?)" in issues$/ do |arg1| | |
12 | - page.should have_content arg1 | |
13 | -end | |
14 | - | |
15 | -Given /^I should not see "(.*?)" in issues$/ do |arg1| | |
16 | - page.should_not have_content arg1 | |
17 | -end | |
18 | - | |
19 | -Then /^I should see issue "(.*?)"$/ do |arg1| | |
20 | - issue = Issue.find_by_title(arg1) | |
21 | - page.should have_content issue.title | |
22 | - page.should have_content issue.author_name | |
23 | - page.should have_content issue.project.name | |
24 | -end | |
25 | - | |
26 | -Given /^I submit new issue "(.*?)"$/ do |arg1| | |
27 | - fill_in "issue_title", with: arg1 | |
28 | - click_button "Submit new issue" | |
29 | -end | |
30 | - | |
31 | -Given /^project "(.*?)" have issues tags:$/ do |arg1, table| | |
32 | - project = Project.find_by_name(arg1) | |
33 | - table.hashes.each do |hash| | |
34 | - Factory :issue, | |
35 | - project: project, | |
36 | - label_list: [hash[:name]] | |
37 | - end | |
38 | -end | |
39 | - | |
40 | -Given /^I visit project "(.*?)" labels page$/ do |arg1| | |
41 | - visit project_labels_path(Project.find_by_name(arg1)) | |
42 | -end | |
43 | - | |
44 | -Then /^I should see label "(.*?)"$/ do |arg1| | |
45 | - within ".labels-table" do | |
46 | - page.should have_content arg1 | |
47 | - end | |
48 | -end | |
49 | - | |
50 | -Given /^I fill in issue search with "(.*?)"$/ do |arg1| | |
51 | - # Because fill_in, with: "" triggers nothing | |
52 | - # we need to trigger a keyup event | |
53 | - if arg1 == '' | |
54 | - page.execute_script("$('.issue_search').val('').keyup();"); | |
55 | - end | |
56 | - fill_in 'issue_search', with: arg1 | |
57 | -end | |
58 | - | |
59 | -When /^I select milestone "(.*?)"$/ do |milestone_title| | |
60 | - select milestone_title, from: "milestone_id" | |
61 | -end | |
62 | - | |
63 | -Then /^I should see selected milestone with title "(.*?)"$/ do |milestone_title| | |
64 | - issues_milestone_selector = "#issue_milestone_id_chzn/a" | |
65 | - wait_until{ page.has_content?("Details") } | |
66 | - page.find(issues_milestone_selector).should have_content(milestone_title) | |
67 | -end | |
68 | - | |
69 | -When /^I select first assignee from "(.*?)" project$/ do |project_name| | |
70 | - project = Project.find_by_name project_name | |
71 | - first_assignee = project.users.first | |
72 | - select first_assignee.name, from: "assignee_id" | |
73 | -end | |
74 | - | |
75 | -Then /^I should see first assignee from "(.*?)" as selected assignee$/ do |project_name| | |
76 | - issues_assignee_selector = "#issue_assignee_id_chzn/a" | |
77 | - wait_until{ page.has_content?("Details") } | |
78 | - project = Project.find_by_name project_name | |
79 | - assignee_name = project.users.first.name | |
80 | - page.find(issues_assignee_selector).should have_content(assignee_name) | |
81 | -end |
features/step_definitions/project/project_merge_requests_steps.rb
... | ... | @@ -1,38 +0,0 @@ |
1 | -Given /^project "(.*?)" have "(.*?)" open merge request$/ do |arg1, arg2| | |
2 | - project = Project.find_by_name(arg1) | |
3 | - Factory.create(:merge_request, :title => arg2, :project => project, :author => project.users.first) | |
4 | -end | |
5 | - | |
6 | -Given /^project "(.*?)" have "(.*?)" closed merge request$/ do |arg1, arg2| | |
7 | - project = Project.find_by_name(arg1) | |
8 | - Factory.create(:merge_request, :title => arg2, :project => project, :author => project.users.first, :closed => true) | |
9 | -end | |
10 | - | |
11 | -Then /^I should see "(.*?)" in merge requests$/ do |arg1| | |
12 | - page.should have_content arg1 | |
13 | -end | |
14 | - | |
15 | -Then /^I should not see "(.*?)" in merge requests$/ do |arg1| | |
16 | - page.should_not have_content arg1 | |
17 | -end | |
18 | - | |
19 | -Then /^I should see merge request "(.*?)"$/ do |arg1| | |
20 | - merge_request = MergeRequest.find_by_title(arg1) | |
21 | - page.should have_content(merge_request.title[0..10]) | |
22 | - page.should have_content(merge_request.target_branch) | |
23 | - page.should have_content(merge_request.source_branch) | |
24 | -end | |
25 | - | |
26 | -Given /^I submit new merge request "(.*?)"$/ do |arg1| | |
27 | - fill_in "merge_request_title", :with => arg1 | |
28 | - select "master", :from => "merge_request_source_branch" | |
29 | - select "stable", :from => "merge_request_target_branch" | |
30 | - click_button "Save" | |
31 | -end | |
32 | - | |
33 | -Then /^I should see closed merge request "(.*?)"$/ do |arg1| | |
34 | - mr = MergeRequest.find_by_title(arg1) | |
35 | - mr.closed.should be_true | |
36 | - page.should have_content "Closed by" | |
37 | -end | |
38 | - |
features/step_definitions/project/project_milestones_steps.rb
... | ... | @@ -1,33 +0,0 @@ |
1 | -Given /^project "(.*?)" has milestone "(.*?)"$/ do |arg1, arg2| | |
2 | - project = Project.find_by_name(arg1) | |
3 | - | |
4 | - milestone = Factory :milestone, | |
5 | - :title => arg2, | |
6 | - :project => project | |
7 | - | |
8 | - 3.times do |i| | |
9 | - issue = Factory :issue, | |
10 | - :project => project, | |
11 | - :milestone => milestone | |
12 | - end | |
13 | -end | |
14 | - | |
15 | -Then /^I should see active milestones$/ do | |
16 | - milestone = @project.milestones.first | |
17 | - page.should have_content(milestone.title[0..10]) | |
18 | - page.should have_content(milestone.expires_at) | |
19 | - page.should have_content("Browse Issues") | |
20 | -end | |
21 | - | |
22 | -Then /^I should see milestone "(.*?)"$/ do |arg1| | |
23 | - milestone = @project.milestones.find_by_title(arg1) | |
24 | - page.should have_content(milestone.title[0..10]) | |
25 | - page.should have_content(milestone.expires_at) | |
26 | - page.should have_content("Browse Issues") | |
27 | -end | |
28 | - | |
29 | -Given /^I submit new milestone "(.*?)"$/ do |arg1| | |
30 | - fill_in "milestone_title", :with => arg1 | |
31 | - click_button "Create milestone" | |
32 | -end | |
33 | - |
features/step_definitions/project/project_team_steps.rb
... | ... | @@ -1,55 +0,0 @@ |
1 | -Given /^gitlab user "(.*?)"$/ do |arg1| | |
2 | - Factory :user, :name => arg1 | |
3 | -end | |
4 | - | |
5 | -Given /^"(.*?)" is "(.*?)" developer$/ do |arg1, arg2| | |
6 | - user = User.find_by_name(arg1) | |
7 | - project = Project.find_by_name(arg2) | |
8 | - project.add_access(user, :write) | |
9 | -end | |
10 | - | |
11 | -Then /^I should be able to see myself in team$/ do | |
12 | - page.should have_content(@user.name) | |
13 | - page.should have_content(@user.email) | |
14 | -end | |
15 | - | |
16 | -Then /^I should see "(.*?)" in team list$/ do |arg1| | |
17 | - user = User.find_by_name(arg1) | |
18 | - page.should have_content(user.name) | |
19 | - page.should have_content(user.email) | |
20 | -end | |
21 | - | |
22 | -Given /^I select "(.*?)" as "(.*?)"$/ do |arg1, arg2| | |
23 | - user = User.find_by_name(arg1) | |
24 | - within "#new_team_member" do | |
25 | - select user.name, :from => "user_ids" | |
26 | - select arg2, :from => "project_access" | |
27 | - end | |
28 | - click_button "Save" | |
29 | -end | |
30 | - | |
31 | -Then /^I should see "(.*?)" in team list as "(.*?)"$/ do |arg1, arg2| | |
32 | - user = User.find_by_name(arg1) | |
33 | - role_id = find(".user_#{user.id} #team_member_project_access").value | |
34 | - role_id.should == UsersProject.access_roles[arg2].to_s | |
35 | -end | |
36 | - | |
37 | -Given /^I change "(.*?)" role to "(.*?)"$/ do |arg1, arg2| | |
38 | - user = User.find_by_name(arg1) | |
39 | - within ".user_#{user.id}" do | |
40 | - select arg2, :from => "team_member_project_access" | |
41 | - end | |
42 | -end | |
43 | - | |
44 | -Then /^I should see "(.*?)" team profile$/ do |arg1| | |
45 | - user = User.find_by_name(arg1) | |
46 | - page.should have_content(user.name) | |
47 | - page.should have_content(user.email) | |
48 | - page.should have_content("To team list") | |
49 | -end | |
50 | - | |
51 | -Then /^I should not see "(.*?)" in team list$/ do |arg1| | |
52 | - user = User.find_by_name(arg1) | |
53 | - page.should_not have_content(user.name) | |
54 | - page.should_not have_content(user.email) | |
55 | -end |
features/step_definitions/project/project_wiki_steps.rb
... | ... | @@ -1,14 +0,0 @@ |
1 | -Given /^I create Wiki page$/ do | |
2 | - fill_in "Title", :with => 'Test title' | |
3 | - fill_in "Content", :with => '[link test](test)' | |
4 | - click_on "Save" | |
5 | -end | |
6 | - | |
7 | -Then /^I should see newly created wiki page$/ do | |
8 | - page.should have_content("Test title") | |
9 | - page.should have_content("link test") | |
10 | - | |
11 | - click_link "link test" | |
12 | - | |
13 | - page.should have_content("Editing page") | |
14 | -end |
features/step_definitions/project/projects_steps.rb
... | ... | @@ -1,77 +0,0 @@ |
1 | -When /^I visit new project page$/ do | |
2 | - visit new_project_path | |
3 | -end | |
4 | - | |
5 | -When /^fill project form with valid data$/ do | |
6 | - fill_in 'project_name', :with => 'NewProject' | |
7 | - fill_in 'project_code', :with => 'NPR' | |
8 | - fill_in 'project_path', :with => 'newproject' | |
9 | - click_button "Create project" | |
10 | -end | |
11 | - | |
12 | -Then /^I should see project page$/ do | |
13 | - current_path.should == project_path(Project.last) | |
14 | - page.should have_content('NewProject') | |
15 | -end | |
16 | - | |
17 | -Then /^I should see empty project instuctions$/ do | |
18 | - page.should have_content("git init") | |
19 | - page.should have_content("git remote") | |
20 | - page.should have_content(Project.last.url_to_repo) | |
21 | -end | |
22 | - | |
23 | -Given /^I own project "(.*?)"$/ do |arg1| | |
24 | - @project = Factory :project, :name => arg1 | |
25 | - @project.add_access(@user, :admin) | |
26 | -end | |
27 | - | |
28 | -Given /^I visit project "(.*?)" wall page$/ do |arg1| | |
29 | - project = Project.find_by_name(arg1) | |
30 | - visit wall_project_path(project) | |
31 | -end | |
32 | - | |
33 | -Then /^I should see project wall note "(.*?)"$/ do |arg1| | |
34 | - page.should have_content arg1 | |
35 | -end | |
36 | - | |
37 | -Given /^project "(.*?)" has comment "(.*?)"$/ do |arg1, arg2| | |
38 | - project = Project.find_by_name(arg1) | |
39 | - project.notes.create(:note => arg1, :author => project.users.first) | |
40 | -end | |
41 | - | |
42 | -Given /^I write new comment "(.*?)"$/ do |arg1| | |
43 | - fill_in "note_note", :with => arg1 | |
44 | - click_button "Add Comment" | |
45 | -end | |
46 | - | |
47 | -Given /^I visit project "(.*?)" page$/ do |arg1| | |
48 | - project = Project.find_by_name(arg1) | |
49 | - visit project_path(project) | |
50 | -end | |
51 | - | |
52 | -Given /^I visit project "(.*?)" network page$/ do |arg1| | |
53 | - project = Project.find_by_name(arg1) | |
54 | - | |
55 | - # Stub out find_all to speed this up (10 commits vs. 650) | |
56 | - commits = Grit::Commit.find_all(project.repo, nil, {max_count: 10}) | |
57 | - Grit::Commit.stub(:find_all).and_return(commits) | |
58 | - | |
59 | - visit graph_project_path(project) | |
60 | -end | |
61 | - | |
62 | -Given /^page should have network graph$/ do | |
63 | - page.should have_content "Project Network Graph" | |
64 | - within ".graph" do | |
65 | - page.should have_content "master" | |
66 | - page.should have_content "scss_refactor..." | |
67 | - end | |
68 | -end | |
69 | - | |
70 | -Given /^I leave a comment like "(.*?)"$/ do |arg1| | |
71 | - fill_in "note_note", :with => arg1 | |
72 | - click_button "Add Comment" | |
73 | -end | |
74 | - | |
75 | -Then /^I should see comment "(.*?)"$/ do |arg1| | |
76 | - page.should have_content(arg1) | |
77 | -end |
features/step_definitions/visit_steps.rb
... | ... | @@ -1,91 +0,0 @@ |
1 | -Given /^I visit project "(.*?)" issues page$/ do |arg1| | |
2 | - visit project_issues_path(Project.find_by_name(arg1)) | |
3 | -end | |
4 | - | |
5 | -Given /^I visit issue page "(.*?)"$/ do |arg1| | |
6 | - issue = Issue.find_by_title(arg1) | |
7 | - visit project_issue_path(issue.project, issue) | |
8 | -end | |
9 | - | |
10 | -Given /^I visit project "(.*?)" merge requests page$/ do |arg1| | |
11 | - visit project_merge_requests_path(Project.find_by_name(arg1)) | |
12 | -end | |
13 | - | |
14 | -Given /^I visit merge request page "(.*?)"$/ do |arg1| | |
15 | - mr = MergeRequest.find_by_title(arg1) | |
16 | - visit project_merge_request_path(mr.project, mr) | |
17 | -end | |
18 | - | |
19 | -Given /^I visit project "(.*?)" milestones page$/ do |arg1| | |
20 | - @project = Project.find_by_name(arg1) | |
21 | - visit project_milestones_path(@project) | |
22 | -end | |
23 | - | |
24 | -Given /^I visit project commits page$/ do | |
25 | - visit project_commits_path(@project) | |
26 | -end | |
27 | - | |
28 | -Given /^I visit compare refs page$/ do | |
29 | - visit compare_project_commits_path(@project) | |
30 | -end | |
31 | - | |
32 | -Given /^I visit project branches page$/ do | |
33 | - visit branches_project_repository_path(@project) | |
34 | -end | |
35 | - | |
36 | -Given /^I visit project commit page$/ do | |
37 | - visit project_commit_path(@project, ValidCommit::ID) | |
38 | -end | |
39 | - | |
40 | -Given /^I visit project tags page$/ do | |
41 | - visit tags_project_repository_path(@project) | |
42 | -end | |
43 | - | |
44 | -Given /^I click on commit link$/ do | |
45 | - visit project_commit_path(@project, ValidCommit::ID) | |
46 | -end | |
47 | - | |
48 | -Given /^I visit project source page$/ do | |
49 | - visit tree_project_ref_path(@project, @project.root_ref) | |
50 | -end | |
51 | - | |
52 | -Given /^I visit project source page for "(.*?)"$/ do |arg1| | |
53 | - visit tree_project_ref_path(@project, arg1) | |
54 | -end | |
55 | - | |
56 | -Given /^I visit blob file from repo$/ do | |
57 | - visit tree_project_ref_path(@project, ValidCommit::ID, :path => ValidCommit::BLOB_FILE_PATH) | |
58 | -end | |
59 | - | |
60 | -Given /^I visit project "(.*?)" team page$/ do |arg1| | |
61 | - visit team_project_path(Project.find_by_name(arg1)) | |
62 | -end | |
63 | - | |
64 | -Given /^I visit project wiki page$/ do | |
65 | - visit project_wiki_path(@project, :index) | |
66 | -end | |
67 | - | |
68 | -Given /^I visit profile page$/ do | |
69 | - visit profile_path | |
70 | -end | |
71 | - | |
72 | -Given /^I visit profile token page$/ do | |
73 | - visit profile_token_path | |
74 | -end | |
75 | - | |
76 | -Given /^I visit profile password page$/ do | |
77 | - visit profile_password_path | |
78 | -end | |
79 | - | |
80 | -Given /^I visit dashboard page$/ do | |
81 | - visit dashboard_path | |
82 | -end | |
83 | - | |
84 | -Given /^I visit dashboard issues page$/ do | |
85 | - visit dashboard_issues_path | |
86 | -end | |
87 | - | |
88 | -Given /^I visit dashboard merge requests page$/ do | |
89 | - visit dashboard_merge_requests_path | |
90 | -end | |
91 | - |
... | ... | @@ -0,0 +1,92 @@ |
1 | +class Dashboard < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedPaths | |
4 | + | |
5 | + Then 'I should see "New Project" link' do | |
6 | + page.should have_link "New Project" | |
7 | + end | |
8 | + | |
9 | + Then 'I should see "Shop" project link' do | |
10 | + page.should have_link "Shop" | |
11 | + end | |
12 | + | |
13 | + Then 'I should see project "Shop" activity feed' do | |
14 | + project = Project.find_by_name("Shop") | |
15 | + page.should have_content "#{@user.name} pushed new branch new_design at #{project.name}" | |
16 | + end | |
17 | + | |
18 | + Then 'I should see last push widget' do | |
19 | + page.should have_content "Your pushed to branch new_design" | |
20 | + page.should have_link "Create Merge Request" | |
21 | + end | |
22 | + | |
23 | + And 'I click "Create Merge Request" link' do | |
24 | + click_link "Create Merge Request" | |
25 | + end | |
26 | + | |
27 | + Then 'I see prefilled new Merge Request page' do | |
28 | + current_path.should == new_project_merge_request_path(@project) | |
29 | + find("#merge_request_source_branch").value.should == "new_design" | |
30 | + find("#merge_request_target_branch").value.should == "master" | |
31 | + find("#merge_request_title").value.should == "New Design" | |
32 | + end | |
33 | + | |
34 | + Given 'user with name "John Doe" joined project "Shop"' do | |
35 | + user = Factory.create(:user, {name: "John Doe"}) | |
36 | + project = Project.find_by_name "Shop" | |
37 | + Event.create( | |
38 | + project: project, | |
39 | + author_id: user.id, | |
40 | + action: Event::Joined | |
41 | + ) | |
42 | + end | |
43 | + | |
44 | + Then 'I should see "John Doe joined project Shop" event' do | |
45 | + page.should have_content "John Doe joined project Shop" | |
46 | + end | |
47 | + | |
48 | + And 'user with name "John Doe" left project "Shop"' do | |
49 | + user = User.find_by_name "John Doe" | |
50 | + project = Project.find_by_name "Shop" | |
51 | + Event.create( | |
52 | + project: project, | |
53 | + author_id: user.id, | |
54 | + action: Event::Left | |
55 | + ) | |
56 | + end | |
57 | + | |
58 | + Then 'I should see "John Doe left project Shop" event' do | |
59 | + page.should have_content "John Doe left project Shop" | |
60 | + end | |
61 | + | |
62 | + And 'I own project "Shop"' do | |
63 | + @project = Factory :project, :name => 'Shop' | |
64 | + @project.add_access(@user, :admin) | |
65 | + end | |
66 | + | |
67 | + And 'project "Shop" has push event' do | |
68 | + @project = Project.find_by_name("Shop") | |
69 | + | |
70 | + data = { | |
71 | + :before => "0000000000000000000000000000000000000000", | |
72 | + :after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", | |
73 | + :ref => "refs/heads/new_design", | |
74 | + :user_id => @user.id, | |
75 | + :user_name => @user.name, | |
76 | + :repository => { | |
77 | + :name => @project.name, | |
78 | + :url => "localhost/rubinius", | |
79 | + :description => "", | |
80 | + :homepage => "localhost/rubinius", | |
81 | + :private => true | |
82 | + } | |
83 | + } | |
84 | + | |
85 | + @event = Event.create( | |
86 | + :project => @project, | |
87 | + :action => Event::Pushed, | |
88 | + :data => data, | |
89 | + :author_id => @user.id | |
90 | + ) | |
91 | + end | |
92 | +end | ... | ... |
... | ... | @@ -0,0 +1,19 @@ |
1 | +class DashboardIssues < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedPaths | |
4 | + | |
5 | + Then 'I should see issues assigned to me' do | |
6 | + issues = @user.issues | |
7 | + issues.each do |issue| | |
8 | + page.should have_content(issue.title[0..10]) | |
9 | + page.should have_content(issue.project.name) | |
10 | + end | |
11 | + end | |
12 | + | |
13 | + And 'I have assigned issues' do | |
14 | + project = Factory :project | |
15 | + project.add_access(@user, :read, :write) | |
16 | + | |
17 | + 2.times { Factory :issue, :author => @user, :assignee => @user, :project => project } | |
18 | + end | |
19 | +end | ... | ... |
... | ... | @@ -0,0 +1,23 @@ |
1 | +class DashboardMergeRequests < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedPaths | |
4 | + | |
5 | + Then 'I should see my merge requests' do | |
6 | + merge_requests = @user.merge_requests | |
7 | + merge_requests.each do |mr| | |
8 | + page.should have_content(mr.title[0..10]) | |
9 | + page.should have_content(mr.project.name) | |
10 | + end | |
11 | + end | |
12 | + | |
13 | + And 'I have authored merge requests' do | |
14 | + project1 = Factory :project | |
15 | + project2 = Factory :project | |
16 | + | |
17 | + project1.add_access(@user, :read, :write) | |
18 | + project2.add_access(@user, :read, :write) | |
19 | + | |
20 | + merge_request1 = Factory :merge_request, :author => @user, :project => project1 | |
21 | + merge_request2 = Factory :merge_request, :author => @user, :project => project2 | |
22 | + end | |
23 | +end | ... | ... |
... | ... | @@ -0,0 +1,18 @@ |
1 | +class DashboardSearch < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedPaths | |
4 | + | |
5 | + Given 'I search for "Sho"' do | |
6 | + fill_in "dashboard_search", :with => "Sho" | |
7 | + click_button "Search" | |
8 | + end | |
9 | + | |
10 | + Then 'I should see "Shop" project link' do | |
11 | + page.should have_link "Shop" | |
12 | + end | |
13 | + | |
14 | + And 'I own project "Shop"' do | |
15 | + @project = Factory :project, :name => "Shop" | |
16 | + @project.add_access(@user, :admin) | |
17 | + end | |
18 | +end | ... | ... |
... | ... | @@ -0,0 +1,44 @@ |
1 | +class Profile < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedPaths | |
4 | + | |
5 | + Then 'I should see my profile info' do | |
6 | + page.should have_content "Profile" | |
7 | + page.should have_content @user.name | |
8 | + page.should have_content @user.email | |
9 | + end | |
10 | + | |
11 | + Then 'I change my contact info' do | |
12 | + fill_in "user_skype", :with => "testskype" | |
13 | + fill_in "user_linkedin", :with => "testlinkedin" | |
14 | + fill_in "user_twitter", :with => "testtwitter" | |
15 | + click_button "Save" | |
16 | + @user.reload | |
17 | + end | |
18 | + | |
19 | + And 'I should see new contact info' do | |
20 | + @user.skype.should == 'testskype' | |
21 | + @user.linkedin.should == 'testlinkedin' | |
22 | + @user.twitter.should == 'testtwitter' | |
23 | + end | |
24 | + | |
25 | + Then 'I change my password' do | |
26 | + fill_in "user_password", :with => "222333" | |
27 | + fill_in "user_password_confirmation", :with => "222333" | |
28 | + click_button "Save" | |
29 | + end | |
30 | + | |
31 | + And 'I should be redirected to sign in page' do | |
32 | + current_path.should == new_user_session_path | |
33 | + end | |
34 | + | |
35 | + Then 'I reset my token' do | |
36 | + @old_token = @user.private_token | |
37 | + click_button "Reset" | |
38 | + end | |
39 | + | |
40 | + And 'I should see new token' do | |
41 | + find("#token").value.should_not == @old_token | |
42 | + find("#token").value.should == @user.reload.private_token | |
43 | + end | |
44 | +end | ... | ... |
... | ... | @@ -0,0 +1,48 @@ |
1 | +class ProfileSshKeys < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + | |
4 | + Then 'I should see my ssh keys' do | |
5 | + @user.keys.each do |key| | |
6 | + page.should have_content(key.title) | |
7 | + end | |
8 | + end | |
9 | + | |
10 | + Given 'I click link "Add new"' do | |
11 | + click_link "Add new" | |
12 | + end | |
13 | + | |
14 | + And 'I submit new ssh key "Laptop"' do | |
15 | + fill_in "key_title", :with => "Laptop" | |
16 | + fill_in "key_key", :with => "ssh-rsa publickey234=" | |
17 | + click_button "Save" | |
18 | + end | |
19 | + | |
20 | + Then 'I should see new ssh key "Laptop"' do | |
21 | + key = Key.find_by_title("Laptop") | |
22 | + page.should have_content(key.title) | |
23 | + page.should have_content(key.key) | |
24 | + current_path.should == key_path(key) | |
25 | + end | |
26 | + | |
27 | + Given 'I click link "Work"' do | |
28 | + click_link "Work" | |
29 | + end | |
30 | + | |
31 | + And 'I click link "Remove"' do | |
32 | + click_link "Remove" | |
33 | + end | |
34 | + | |
35 | + Then 'I visit profile keys page' do | |
36 | + visit keys_path | |
37 | + end | |
38 | + | |
39 | + And 'I should not see "Work" ssh key' do | |
40 | + within "#keys-table" do | |
41 | + page.should_not have_content "Work" | |
42 | + end | |
43 | + end | |
44 | + | |
45 | + And 'I have ssh key "ssh-rsa Work"' do | |
46 | + Factory :key, :user => @user, :title => "ssh-rsa Work", :key => "jfKLJDFKSFJSHFJssh-rsa Work" | |
47 | + end | |
48 | +end | ... | ... |
... | ... | @@ -0,0 +1,22 @@ |
1 | +class CreateProject < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedPaths | |
4 | + | |
5 | + And 'fill project form with valid data' do | |
6 | + fill_in 'project_name', :with => 'NewProject' | |
7 | + fill_in 'project_code', :with => 'NPR' | |
8 | + fill_in 'project_path', :with => 'newproject' | |
9 | + click_button "Create project" | |
10 | + end | |
11 | + | |
12 | + Then 'I should see project page' do | |
13 | + current_path.should == project_path(Project.last) | |
14 | + page.should have_content "NewProject" | |
15 | + end | |
16 | + | |
17 | + And 'I should see empty project instuctions' do | |
18 | + page.should have_content "git init" | |
19 | + page.should have_content "git remote" | |
20 | + page.should have_content Project.last.url_to_repo | |
21 | + end | |
22 | +end | ... | ... |
... | ... | @@ -0,0 +1,35 @@ |
1 | +class ProjectBrowseBranches < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + include SharedPaths | |
5 | + | |
6 | + Then 'I should see "Shop" recent branches list' do | |
7 | + page.should have_content "Branches" | |
8 | + page.should have_content "master" | |
9 | + end | |
10 | + | |
11 | + Given 'I click link "All"' do | |
12 | + click_link "All" | |
13 | + end | |
14 | + | |
15 | + Then 'I should see "Shop" all branches list' do | |
16 | + page.should have_content "Branches" | |
17 | + page.should have_content "master" | |
18 | + end | |
19 | + | |
20 | + Given 'I click link "Protected"' do | |
21 | + click_link "Protected" | |
22 | + end | |
23 | + | |
24 | + Then 'I should see "Shop" protected branches list' do | |
25 | + within "table" do | |
26 | + page.should have_content "stable" | |
27 | + page.should_not have_content "master" | |
28 | + end | |
29 | + end | |
30 | + | |
31 | + And 'project "Shop" has protected branches' do | |
32 | + project = Project.find_by_name("Shop") | |
33 | + project.protected_branches.create(:name => "stable") | |
34 | + end | |
35 | +end | ... | ... |
... | ... | @@ -0,0 +1,47 @@ |
1 | +class ProjectBrowseCommits < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + include SharedPaths | |
5 | + | |
6 | + Then 'I see project commits' do | |
7 | + current_path.should == project_commits_path(@project) | |
8 | + | |
9 | + commit = @project.commit | |
10 | + page.should have_content(@project.name) | |
11 | + page.should have_content(commit.message) | |
12 | + page.should have_content(commit.id.to_s[0..5]) | |
13 | + end | |
14 | + | |
15 | + Given 'I click atom feed link' do | |
16 | + click_link "Feed" | |
17 | + end | |
18 | + | |
19 | + Then 'I see commits atom feed' do | |
20 | + commit = CommitDecorator.decorate(@project.commit) | |
21 | + page.response_headers['Content-Type'].should have_content("application/atom+xml") | |
22 | + page.body.should have_selector("title", :text => "Recent commits to #{@project.name}") | |
23 | + page.body.should have_selector("author email", :text => commit.author_email) | |
24 | + page.body.should have_selector("entry summary", :text => commit.description) | |
25 | + end | |
26 | + | |
27 | + Given 'I click on commit link' do | |
28 | + visit project_commit_path(@project, ValidCommit::ID) | |
29 | + end | |
30 | + | |
31 | + Then 'I see commit info' do | |
32 | + page.should have_content ValidCommit::MESSAGE | |
33 | + page.should have_content "Showing 1 changed file" | |
34 | + end | |
35 | + | |
36 | + And 'I fill compare fields with refs' do | |
37 | + fill_in "from", :with => "master" | |
38 | + fill_in "to", :with => "stable" | |
39 | + click_button "Compare" | |
40 | + end | |
41 | + | |
42 | + And 'I see compared refs' do | |
43 | + page.should have_content "Commits (27)" | |
44 | + page.should have_content "Compare View" | |
45 | + page.should have_content "Showing 73 changed files" | |
46 | + end | |
47 | +end | ... | ... |
... | ... | @@ -0,0 +1,34 @@ |
1 | +class ProjectBrowseFiles < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + include SharedPaths | |
5 | + | |
6 | + Then 'I should see files from repository' do | |
7 | + page.should have_content "app" | |
8 | + page.should have_content "History" | |
9 | + page.should have_content "Gemfile" | |
10 | + end | |
11 | + | |
12 | + Then 'I should see files from repository for "8470d70"' do | |
13 | + current_path.should == tree_project_ref_path(@project, "8470d70") | |
14 | + page.should have_content "app" | |
15 | + page.should have_content "History" | |
16 | + page.should have_content "Gemfile" | |
17 | + end | |
18 | + | |
19 | + Given 'I click on "Gemfile" file in repo' do | |
20 | + click_link "Gemfile" | |
21 | + end | |
22 | + | |
23 | + Then 'I should see it content' do | |
24 | + page.should have_content "rubygems.org" | |
25 | + end | |
26 | + | |
27 | + And 'I click link "raw"' do | |
28 | + click_link "raw" | |
29 | + end | |
30 | + | |
31 | + Then 'I should see raw file content' do | |
32 | + page.source.should == ValidCommit::BLOB_FILE | |
33 | + end | |
34 | +end | ... | ... |
... | ... | @@ -0,0 +1,19 @@ |
1 | +class ProjectBrowseGitRepo < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + include SharedPaths | |
5 | + | |
6 | + Given 'I click on "Gemfile" file in repo' do | |
7 | + click_link "Gemfile" | |
8 | + end | |
9 | + | |
10 | + And 'I click blame button' do | |
11 | + click_link "blame" | |
12 | + end | |
13 | + | |
14 | + Then 'I should see git file blame' do | |
15 | + page.should have_content "rubygems.org" | |
16 | + page.should have_content "Dmitriy Zaporozhets" | |
17 | + page.should have_content "bc3735004cb Moving to rails 3.2" | |
18 | + end | |
19 | +end | ... | ... |
... | ... | @@ -0,0 +1,10 @@ |
1 | +class ProjectBrowseTags < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + include SharedPaths | |
5 | + | |
6 | + Then 'I should see "Shop" all tags list' do | |
7 | + page.should have_content "Tags" | |
8 | + page.should have_content "v1.2.1" | |
9 | + end | |
10 | +end | ... | ... |
... | ... | @@ -0,0 +1,134 @@ |
1 | +class ProjectIssues < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + include SharedNote | |
5 | + include SharedPaths | |
6 | + | |
7 | + Given 'I should see "Release 0.4" in issues' do | |
8 | + page.should have_content "Release 0.4" | |
9 | + end | |
10 | + | |
11 | + And 'I should not see "Release 0.3" in issues' do | |
12 | + page.should_not have_content "Release 0.3" | |
13 | + end | |
14 | + | |
15 | + Given 'I click link "Closed"' do | |
16 | + click_link "Closed" | |
17 | + end | |
18 | + | |
19 | + Then 'I should see "Release 0.3" in issues' do | |
20 | + page.should have_content "Release 0.3" | |
21 | + end | |
22 | + | |
23 | + And 'I should not see "Release 0.4" in issues' do | |
24 | + page.should_not have_content "Release 0.4" | |
25 | + end | |
26 | + | |
27 | + Given 'I click link "All"' do | |
28 | + click_link "All" | |
29 | + end | |
30 | + | |
31 | + Given 'I click link "Release 0.4"' do | |
32 | + click_link "Release 0.4" | |
33 | + end | |
34 | + | |
35 | + Then 'I should see issue "Release 0.4"' do | |
36 | + page.should have_content "Release 0.4" | |
37 | + end | |
38 | + | |
39 | + Given 'I click link "New Issue"' do | |
40 | + click_link "New Issue" | |
41 | + end | |
42 | + | |
43 | + And 'I submit new issue "500 error on profile"' do | |
44 | + fill_in "issue_title", :with => "500 error on profile" | |
45 | + click_button "Submit new issue" | |
46 | + end | |
47 | + | |
48 | + Given 'I click link "500 error on profile"' do | |
49 | + click_link "500 error on profile" | |
50 | + end | |
51 | + | |
52 | + Then 'I should see issue "500 error on profile"' do | |
53 | + issue = Issue.find_by_title("500 error on profile") | |
54 | + page.should have_content issue.title | |
55 | + page.should have_content issue.author_name | |
56 | + page.should have_content issue.project.name | |
57 | + end | |
58 | + | |
59 | + Given 'I fill in issue search with "Release"' do | |
60 | + fill_in 'issue_search', with: "Release" | |
61 | + end | |
62 | + | |
63 | + Given 'I fill in issue search with "Bug"' do | |
64 | + fill_in 'issue_search', with: "Bug" | |
65 | + end | |
66 | + | |
67 | + And 'I fill in issue search with "0.3"' do | |
68 | + fill_in 'issue_search', with: "0.3" | |
69 | + end | |
70 | + | |
71 | + And 'I fill in issue search with "Something"' do | |
72 | + fill_in 'issue_search', with: "Something" | |
73 | + end | |
74 | + | |
75 | + And 'I fill in issue search with ""' do | |
76 | + page.execute_script("$('.issue_search').val('').keyup();"); | |
77 | + fill_in 'issue_search', with: "" | |
78 | + end | |
79 | + | |
80 | + Given 'project "Shop" has milestone "v2.2"' do | |
81 | + project = Project.find_by_name("Shop") | |
82 | + milestone = Factory :milestone, :title => "v2.2", :project => project | |
83 | + | |
84 | + 3.times { Factory :issue, :project => project, :milestone => milestone } | |
85 | + end | |
86 | + | |
87 | + And 'project "Shop" has milestone "v3.0"' do | |
88 | + project = Project.find_by_name("Shop") | |
89 | + milestone = Factory :milestone, :title => "v3.0", :project => project | |
90 | + | |
91 | + 3.times { Factory :issue, :project => project, :milestone => milestone } | |
92 | + end | |
93 | + | |
94 | + When 'I select milestone "v3.0"' do | |
95 | + select "v3.0", from: "milestone_id" | |
96 | + end | |
97 | + | |
98 | + Then 'I should see selected milestone with title "v3.0"' do | |
99 | + issues_milestone_selector = "#issue_milestone_id_chzn/a" | |
100 | + wait_until { page.has_content?("Details") } | |
101 | + page.find(issues_milestone_selector).should have_content("v3.0") | |
102 | + end | |
103 | + | |
104 | + When 'I select first assignee from "Shop" project' do | |
105 | + project = Project.find_by_name "Shop" | |
106 | + first_assignee = project.users.first | |
107 | + select first_assignee.name, from: "assignee_id" | |
108 | + end | |
109 | + | |
110 | + Then 'I should see first assignee from "Shop" as selected assignee' do | |
111 | + issues_assignee_selector = "#issue_assignee_id_chzn/a" | |
112 | + wait_until { page.has_content?("Details") } | |
113 | + project = Project.find_by_name "Shop" | |
114 | + assignee_name = project.users.first.name | |
115 | + page.find(issues_assignee_selector).should have_content(assignee_name) | |
116 | + end | |
117 | + | |
118 | + And 'project "Shop" have "Release 0.4" open issue' do | |
119 | + project = Project.find_by_name("Shop") | |
120 | + Factory.create(:issue, | |
121 | + :title => "Release 0.4", | |
122 | + :project => project, | |
123 | + :author => project.users.first) | |
124 | + end | |
125 | + | |
126 | + And 'project "Shop" have "Release 0.3" closed issue' do | |
127 | + project = Project.find_by_name("Shop") | |
128 | + Factory.create(:issue, | |
129 | + :title => "Release 0.3", | |
130 | + :project => project, | |
131 | + :author => project.users.first, | |
132 | + :closed => true) | |
133 | + end | |
134 | +end | ... | ... |
... | ... | @@ -0,0 +1,24 @@ |
1 | +class ProjectLabels < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + include SharedPaths | |
5 | + | |
6 | + Then 'I should see label "bug"' do | |
7 | + within ".labels-table" do | |
8 | + page.should have_content "bug" | |
9 | + end | |
10 | + end | |
11 | + | |
12 | + And 'I should see label "feature"' do | |
13 | + within ".labels-table" do | |
14 | + page.should have_content "feature" | |
15 | + end | |
16 | + end | |
17 | + | |
18 | + And 'project "Shop" have issues tags: "bug", "feature"' do | |
19 | + project = Project.find_by_name("Shop") | |
20 | + ['bug', 'feature'].each do |label| | |
21 | + Factory :issue, project: project, label_list: label | |
22 | + end | |
23 | + end | |
24 | +end | ... | ... |
... | ... | @@ -0,0 +1,80 @@ |
1 | +class ProjectMergeRequests < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + include SharedNote | |
5 | + include SharedPaths | |
6 | + | |
7 | + Then 'I should see "Bug NS-04" in merge requests' do | |
8 | + page.should have_content "Bug NS-04" | |
9 | + end | |
10 | + | |
11 | + And 'I should not see "Feature NS-03" in merge requests' do | |
12 | + page.should_not have_content "Feature NS-03" | |
13 | + end | |
14 | + | |
15 | + Given 'I click link "Closed"' do | |
16 | + click_link "Closed" | |
17 | + end | |
18 | + | |
19 | + Then 'I should see "Feature NS-03" in merge requests' do | |
20 | + page.should have_content "Feature NS-03" | |
21 | + end | |
22 | + | |
23 | + And 'I should not see "Bug NS-04" in merge requests' do | |
24 | + page.should_not have_content "Bug NS-04" | |
25 | + end | |
26 | + | |
27 | + Given 'I click link "All"' do | |
28 | + click_link "All" | |
29 | + end | |
30 | + | |
31 | + Given 'I click link "Bug NS-04"' do | |
32 | + click_link "Bug NS-04" | |
33 | + end | |
34 | + | |
35 | + Then 'I should see merge request "Bug NS-04"' do | |
36 | + page.should have_content "Bug NS-04" | |
37 | + end | |
38 | + | |
39 | + And 'I click link "Close"' do | |
40 | + click_link "Close" | |
41 | + end | |
42 | + | |
43 | + Then 'I should see closed merge request "Bug NS-04"' do | |
44 | + mr = MergeRequest.find_by_title("Bug NS-04") | |
45 | + mr.closed.should be_true | |
46 | + page.should have_content "Closed by" | |
47 | + end | |
48 | + | |
49 | + Given 'I click link "New Merge Request"' do | |
50 | + click_link "New Merge Request" | |
51 | + end | |
52 | + | |
53 | + And 'I submit new merge request "Wiki Feature"' do | |
54 | + fill_in "merge_request_title", :with => "Wiki Feature" | |
55 | + select "master", :from => "merge_request_source_branch" | |
56 | + select "stable", :from => "merge_request_target_branch" | |
57 | + click_button "Save" | |
58 | + end | |
59 | + | |
60 | + Then 'I should see merge request "Wiki Feature"' do | |
61 | + page.should have_content "Wiki Feature" | |
62 | + end | |
63 | + | |
64 | + And 'project "Shop" have "Bug NS-04" open merge request' do | |
65 | + project = Project.find_by_name("Shop") | |
66 | + Factory.create(:merge_request, | |
67 | + :title => "Bug NS-04", | |
68 | + :project => project, | |
69 | + :author => project.users.first) | |
70 | + end | |
71 | + | |
72 | + And 'project "Shop" have "Feature NS-03" closed merge request' do | |
73 | + project = Project.find_by_name("Shop") | |
74 | + Factory.create(:merge_request, | |
75 | + :title => "Feature NS-03", | |
76 | + :project => project, | |
77 | + :author => project.users.first, | |
78 | + :closed => true) | |
79 | + end | |
80 | +end | ... | ... |
... | ... | @@ -0,0 +1,39 @@ |
1 | +class ProjectMilestones < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + include SharedPaths | |
5 | + | |
6 | + Then 'I should see milestone "v2.2"' do | |
7 | + milestone = @project.milestones.find_by_title("v2.2") | |
8 | + page.should have_content(milestone.title[0..10]) | |
9 | + page.should have_content(milestone.expires_at) | |
10 | + page.should have_content("Browse Issues") | |
11 | + end | |
12 | + | |
13 | + Given 'I click link "v2.2"' do | |
14 | + click_link "v2.2" | |
15 | + end | |
16 | + | |
17 | + Given 'I click link "New Milestone"' do | |
18 | + click_link "New Milestone" | |
19 | + end | |
20 | + | |
21 | + And 'I submit new milestone "v2.3"' do | |
22 | + fill_in "milestone_title", :with => "v2.3" | |
23 | + click_button "Create milestone" | |
24 | + end | |
25 | + | |
26 | + Then 'I should see milestone "v2.3"' do | |
27 | + milestone = @project.milestones.find_by_title("v2.3") | |
28 | + page.should have_content(milestone.title[0..10]) | |
29 | + page.should have_content(milestone.expires_at) | |
30 | + page.should have_content("Browse Issues") | |
31 | + end | |
32 | + | |
33 | + And 'project "Shop" has milestone "v2.2"' do | |
34 | + project = Project.find_by_name("Shop") | |
35 | + milestone = Factory :milestone, :title => "v2.2", :project => project | |
36 | + | |
37 | + 3.times { Factory :issue, :project => project, :milestone => milestone } | |
38 | + end | |
39 | +end | ... | ... |
... | ... | @@ -0,0 +1,22 @@ |
1 | +class ProjectNetworkGraph < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + | |
5 | + Then 'page should have network graph' do | |
6 | + page.should have_content "Project Network Graph" | |
7 | + within ".graph" do | |
8 | + page.should have_content "master" | |
9 | + page.should have_content "scss_refactor..." | |
10 | + end | |
11 | + end | |
12 | + | |
13 | + And 'I visit project "Shop" network page' do | |
14 | + project = Project.find_by_name("Shop") | |
15 | + | |
16 | + # Stub out find_all to speed this up (10 commits vs. 650) | |
17 | + commits = Grit::Commit.find_all(project.repo, nil, {max_count: 10}) | |
18 | + Grit::Commit.stub(:find_all).and_return(commits) | |
19 | + | |
20 | + visit graph_project_path(project) | |
21 | + end | |
22 | +end | ... | ... |
... | ... | @@ -0,0 +1,89 @@ |
1 | +class ProjectTeamManagement < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + include SharedPaths | |
5 | + | |
6 | + Then 'I should be able to see myself in team' do | |
7 | + page.should have_content(@user.name) | |
8 | + page.should have_content(@user.email) | |
9 | + end | |
10 | + | |
11 | + And 'I should see "Sam" in team list' do | |
12 | + user = User.find_by_name("Sam") | |
13 | + page.should have_content(user.name) | |
14 | + page.should have_content(user.email) | |
15 | + end | |
16 | + | |
17 | + Given 'I click link "New Team Member"' do | |
18 | + click_link "New Team Member" | |
19 | + end | |
20 | + | |
21 | + And 'I select "Mike" as "Reporter"' do | |
22 | + user = User.find_by_name("Mike") | |
23 | + within "#new_team_member" do | |
24 | + select user.name, :from => "user_ids" | |
25 | + select "Reporter", :from => "project_access" | |
26 | + end | |
27 | + click_button "Save" | |
28 | + end | |
29 | + | |
30 | + Then 'I should see "Mike" in team list as "Reporter"' do | |
31 | + user = User.find_by_name("Mike") | |
32 | + role_id = find(".user_#{user.id} #team_member_project_access").value | |
33 | + role_id.should == UsersProject.access_roles["Reporter"].to_s | |
34 | + end | |
35 | + | |
36 | + Given 'I should see "Sam" in team list as "Developer"' do | |
37 | + user = User.find_by_name("Sam") | |
38 | + role_id = find(".user_#{user.id} #team_member_project_access").value | |
39 | + role_id.should == UsersProject.access_roles["Developer"].to_s | |
40 | + end | |
41 | + | |
42 | + And 'I change "Sam" role to "Reporter"' do | |
43 | + user = User.find_by_name("Sam") | |
44 | + within ".user_#{user.id}" do | |
45 | + select "Reporter", :from => "team_member_project_access" | |
46 | + end | |
47 | + end | |
48 | + | |
49 | + And 'I should see "Sam" in team list as "Reporter"' do | |
50 | + user = User.find_by_name("Sam") | |
51 | + role_id = find(".user_#{user.id} #team_member_project_access").value | |
52 | + role_id.should == UsersProject.access_roles["Reporter"].to_s | |
53 | + end | |
54 | + | |
55 | + Given 'I click link "Sam"' do | |
56 | + click_link "Sam" | |
57 | + end | |
58 | + | |
59 | + Then 'I should see "Sam" team profile' do | |
60 | + user = User.find_by_name("Sam") | |
61 | + page.should have_content(user.name) | |
62 | + page.should have_content(user.email) | |
63 | + page.should have_content("To team list") | |
64 | + end | |
65 | + | |
66 | + And 'I click link "Remove from team"' do | |
67 | + click_link "Remove from team" | |
68 | + end | |
69 | + | |
70 | + And 'I should not see "Sam" in team list' do | |
71 | + user = User.find_by_name("Sam") | |
72 | + page.should_not have_content(user.name) | |
73 | + page.should_not have_content(user.email) | |
74 | + end | |
75 | + | |
76 | + And 'gitlab user "Mike"' do | |
77 | + Factory :user, :name => "Mike" | |
78 | + end | |
79 | + | |
80 | + And 'gitlab user "Sam"' do | |
81 | + Factory :user, :name => "Sam" | |
82 | + end | |
83 | + | |
84 | + And '"Sam" is "Shop" developer' do | |
85 | + user = User.find_by_name("Sam") | |
86 | + project = Project.find_by_name("Shop") | |
87 | + project.add_access(user, :write) | |
88 | + end | |
89 | +end | ... | ... |
... | ... | @@ -0,0 +1,20 @@ |
1 | +class ProjectWiki < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedProject | |
4 | + include SharedNote | |
5 | + include SharedPaths | |
6 | + | |
7 | + Given 'I create Wiki page' do | |
8 | + fill_in "Title", :with => 'Test title' | |
9 | + fill_in "Content", :with => '[link test](test)' | |
10 | + click_on "Save" | |
11 | + end | |
12 | + | |
13 | + Then 'I should see newly created wiki page' do | |
14 | + page.should have_content "Test title" | |
15 | + page.should have_content "link test" | |
16 | + | |
17 | + click_link "link test" | |
18 | + page.should have_content "Editing page" | |
19 | + end | |
20 | +end | ... | ... |
... | ... | @@ -0,0 +1,21 @@ |
1 | +module SharedNote | |
2 | + include Spinach::DSL | |
3 | + | |
4 | + Given 'I leave a comment like "XML attached"' do | |
5 | + fill_in "note_note", :with => "XML attached" | |
6 | + click_button "Add Comment" | |
7 | + end | |
8 | + | |
9 | + Then 'I should see comment "XML attached"' do | |
10 | + page.should have_content "XML attached" | |
11 | + end | |
12 | + | |
13 | + Given 'I write new comment "my special test message"' do | |
14 | + fill_in "note_note", :with => "my special test message" | |
15 | + click_button "Add Comment" | |
16 | + end | |
17 | + | |
18 | + Then 'I should see project wall note "my special test message"' do | |
19 | + page.should have_content "my special test message" | |
20 | + end | |
21 | +end | ... | ... |
... | ... | @@ -0,0 +1,112 @@ |
1 | +module SharedPaths | |
2 | + include Spinach::DSL | |
3 | + | |
4 | + And 'I visit dashboard search page' do | |
5 | + visit search_path | |
6 | + end | |
7 | + | |
8 | + And 'I visit dashboard merge requests page' do | |
9 | + visit dashboard_merge_requests_path | |
10 | + end | |
11 | + | |
12 | + And 'I visit dashboard issues page' do | |
13 | + visit dashboard_issues_path | |
14 | + end | |
15 | + | |
16 | + When 'I visit dashboard page' do | |
17 | + visit dashboard_path | |
18 | + end | |
19 | + | |
20 | + Given 'I visit profile page' do | |
21 | + visit profile_path | |
22 | + end | |
23 | + | |
24 | + Given 'I visit profile password page' do | |
25 | + visit profile_password_path | |
26 | + end | |
27 | + | |
28 | + Given 'I visit profile token page' do | |
29 | + visit profile_token_path | |
30 | + end | |
31 | + | |
32 | + When 'I visit new project page' do | |
33 | + visit new_project_path | |
34 | + end | |
35 | + | |
36 | + And 'I visit project "Shop" page' do | |
37 | + project = Project.find_by_name("Shop") | |
38 | + visit project_path(project) | |
39 | + end | |
40 | + | |
41 | + Given 'I visit project branches page' do | |
42 | + visit branches_project_repository_path(@project) | |
43 | + end | |
44 | + | |
45 | + Given 'I visit compare refs page' do | |
46 | + visit compare_project_commits_path(@project) | |
47 | + end | |
48 | + | |
49 | + Given 'I visit project commits page' do | |
50 | + visit project_commits_path(@project) | |
51 | + end | |
52 | + | |
53 | + Given 'I visit project source page' do | |
54 | + visit tree_project_ref_path(@project, @project.root_ref) | |
55 | + end | |
56 | + | |
57 | + Given 'I visit blob file from repo' do | |
58 | + visit tree_project_ref_path(@project, ValidCommit::ID, :path => ValidCommit::BLOB_FILE_PATH) | |
59 | + end | |
60 | + | |
61 | + Given 'I visit project source page for "8470d70"' do | |
62 | + visit tree_project_ref_path(@project, "8470d70") | |
63 | + end | |
64 | + | |
65 | + Given 'I visit project tags page' do | |
66 | + visit tags_project_repository_path(@project) | |
67 | + end | |
68 | + | |
69 | + Given 'I visit project commit page' do | |
70 | + visit project_commit_path(@project, ValidCommit::ID) | |
71 | + end | |
72 | + | |
73 | + And 'I visit project "Shop" issues page' do | |
74 | + visit project_issues_path(Project.find_by_name("Shop")) | |
75 | + end | |
76 | + | |
77 | + Given 'I visit issue page "Release 0.4"' do | |
78 | + issue = Issue.find_by_title("Release 0.4") | |
79 | + visit project_issue_path(issue.project, issue) | |
80 | + end | |
81 | + | |
82 | + Given 'I visit project "Shop" labels page' do | |
83 | + visit project_labels_path(Project.find_by_name("Shop")) | |
84 | + end | |
85 | + | |
86 | + Given 'I visit merge request page "Bug NS-04"' do | |
87 | + mr = MergeRequest.find_by_title("Bug NS-04") | |
88 | + visit project_merge_request_path(mr.project, mr) | |
89 | + end | |
90 | + | |
91 | + And 'I visit project "Shop" merge requests page' do | |
92 | + visit project_merge_requests_path(Project.find_by_name("Shop")) | |
93 | + end | |
94 | + | |
95 | + Given 'I visit project "Shop" milestones page' do | |
96 | + @project = Project.find_by_name("Shop") | |
97 | + visit project_milestones_path(@project) | |
98 | + end | |
99 | + | |
100 | + Then 'I visit project "Shop" team page' do | |
101 | + visit team_project_path(Project.find_by_name("Shop")) | |
102 | + end | |
103 | + | |
104 | + Then 'I visit project "Shop" wall page' do | |
105 | + project = Project.find_by_name("Shop") | |
106 | + visit wall_project_path(project) | |
107 | + end | |
108 | + | |
109 | + Given 'I visit project wiki page' do | |
110 | + visit project_wiki_path(@project, :index) | |
111 | + end | |
112 | +end | ... | ... |
features/support/env.rb
1 | -unless ENV['CI'] | |
2 | - require 'simplecov' | |
3 | - SimpleCov.start 'rails' | |
4 | -end | |
5 | - | |
6 | -require 'cucumber/rails' | |
7 | -require 'webmock/cucumber' | |
8 | - | |
9 | -WebMock.allow_net_connect! | |
10 | - | |
11 | -require Rails.root.join 'spec/support/gitolite_stub' | |
12 | -require Rails.root.join 'spec/support/stubbed_repository' | |
13 | -require Rails.root.join 'spec/support/login_helpers' | |
14 | -require Rails.root.join 'spec/support/valid_commit' | |
1 | +ENV['RAILS_ENV'] = 'test' | |
2 | +require './config/environment' | |
15 | 3 | |
16 | -Capybara.default_selector = :css | |
17 | -Capybara.javascript_driver = :webkit | |
4 | +require 'rspec' | |
5 | +require 'database_cleaner' | |
6 | +require 'spinach/capybara' | |
18 | 7 | |
19 | -# By default, any exception happening in your Rails application will bubble up | |
20 | -# to Cucumber so that your scenario will fail. This is a different from how | |
21 | -# your application behaves in the production environment, where an error page will | |
22 | -# be rendered instead. | |
23 | -# | |
24 | -# Sometimes we want to override this default behaviour and allow Rails to rescue | |
25 | -# exceptions and display an error page (just like when the app is running in production). | |
26 | -# Typical scenarios where you want to do this is when you test your error pages. | |
27 | -# There are two ways to allow Rails to rescue exceptions: | |
28 | -# | |
29 | -# 1) Tag your scenario (or feature) with @allow-rescue | |
30 | -# | |
31 | -# 2) Set the value below to true. Beware that doing this globally is not | |
32 | -# recommended as it will mask a lot of errors for you! | |
33 | -# | |
34 | -ActionController::Base.allow_rescue = false | |
35 | - | |
36 | -# Remove/comment out the lines below if your app doesn't have a database. | |
37 | -# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead. | |
38 | -begin | |
39 | - DatabaseCleaner.strategy = :transaction | |
40 | -rescue NameError | |
41 | - raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it." | |
8 | +%w(gitolite_stub stubbed_repository valid_commit).each do |f| | |
9 | + require Rails.root.join('spec', 'support', f) | |
42 | 10 | end |
43 | 11 | |
44 | -Cucumber::Rails::Database.javascript_strategy = :truncation | |
12 | +Dir["#{Rails.root}/features/steps/shared/*.rb"].each {|file| require file} | |
45 | 13 | |
46 | -require 'headless' | |
14 | +include GitoliteStub | |
47 | 15 | |
48 | -headless = Headless.new | |
49 | -headless.start | |
16 | +WebMock.allow_net_connect! | |
17 | +Capybara.javascript_driver = :webkit | |
50 | 18 | |
51 | -require 'cucumber/rspec/doubles' | |
19 | +DatabaseCleaner.strategy = :truncation | |
20 | +Spinach.hooks.before_scenario { DatabaseCleaner.start } | |
21 | +Spinach.hooks.after_scenario { DatabaseCleaner.clean } | |
52 | 22 | |
53 | -include GitoliteStub | |
23 | +Spinach.hooks.before_run do | |
24 | + RSpec::Mocks::setup self | |
54 | 25 | |
55 | -Before do | |
56 | 26 | stub_gitolite! |
57 | 27 | end |
58 | - | |
59 | -World(FactoryGirl::Syntax::Methods) | ... | ... |
lib/tasks/cucumber.rake
... | ... | @@ -1,65 +0,0 @@ |
1 | -# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. | |
2 | -# It is recommended to regenerate this file in the future when you upgrade to a | |
3 | -# newer version of cucumber-rails. Consider adding your own code to a new file | |
4 | -# instead of editing this one. Cucumber will automatically load all features/**/*.rb | |
5 | -# files. | |
6 | - | |
7 | - | |
8 | -unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks | |
9 | - | |
10 | -vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first | |
11 | -$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil? | |
12 | - | |
13 | -begin | |
14 | - require 'cucumber/rake/task' | |
15 | - | |
16 | - namespace :cucumber do | |
17 | - Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t| | |
18 | - t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. | |
19 | - t.fork = true # You may get faster startup if you set this to false | |
20 | - t.profile = 'default' | |
21 | - end | |
22 | - | |
23 | - Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t| | |
24 | - t.binary = vendored_cucumber_bin | |
25 | - t.fork = true # You may get faster startup if you set this to false | |
26 | - t.profile = 'wip' | |
27 | - end | |
28 | - | |
29 | - Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t| | |
30 | - t.binary = vendored_cucumber_bin | |
31 | - t.fork = true # You may get faster startup if you set this to false | |
32 | - t.profile = 'rerun' | |
33 | - end | |
34 | - | |
35 | - desc 'Run all features' | |
36 | - task :all => [:ok, :wip] | |
37 | - | |
38 | - task :statsetup do | |
39 | - require 'rails/code_statistics' | |
40 | - ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features') | |
41 | - ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features') | |
42 | - end | |
43 | - end | |
44 | - desc 'Alias for cucumber:ok' | |
45 | - task :cucumber => 'cucumber:ok' | |
46 | - | |
47 | - task :default => :cucumber | |
48 | - | |
49 | - task :features => :cucumber do | |
50 | - STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" | |
51 | - end | |
52 | - | |
53 | - # In case we don't have ActiveRecord, append a no-op task that we can depend upon. | |
54 | - task 'db:test:prepare' do | |
55 | - end | |
56 | - | |
57 | - task :stats => 'cucumber:statsetup' | |
58 | -rescue LoadError | |
59 | - desc 'cucumber rake task not available (cucumber not installed)' | |
60 | - task :cucumber do | |
61 | - abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' | |
62 | - end | |
63 | -end | |
64 | - | |
65 | -end |
lib/tasks/gitlab/test.rake
lib/tasks/travis.rake
script/cucumber
... | ... | @@ -1,10 +0,0 @@ |
1 | -#!/usr/bin/env ruby | |
2 | - | |
3 | -vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first | |
4 | -if vendored_cucumber_bin | |
5 | - load File.expand_path(vendored_cucumber_bin) | |
6 | -else | |
7 | - require 'rubygems' unless ENV['NO_RUBYGEMS'] | |
8 | - require 'cucumber' | |
9 | - load Cucumber::BINARY | |
10 | -end |