Commit 170340e6b15f91e79cf683c892ec887c3115b317

Authored by Ciro Santillli
1 parent e868de68

Remove dir prefix and suffix from tests inside dir.

Showing 118 changed files with 3317 additions and 3317 deletions   Show diff stats
features/project/archived.feature 0 → 100644
@@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
  1 +Feature: Project Archived
  2 + Background:
  3 + Given I sign in as a user
  4 + And I own project "Shop"
  5 + And I own project "Forum"
  6 +
  7 + Scenario: I should not see archived on project page of not-archive project
  8 + And project "Forum" is archived
  9 + And I visit project "Shop" page
  10 + Then I should not see "Archived"
  11 +
  12 + Scenario: I should see archived on project page of archive project
  13 + And project "Forum" is archived
  14 + And I visit project "Forum" page
  15 + Then I should see "Archived"
  16 +
  17 + Scenario: I should not see archived on projects page with no archived projects
  18 + And I visit dashboard projects page
  19 + Then I should not see "Archived"
  20 +
  21 + Scenario: I should see archived on projects page with archived projects
  22 + And project "Forum" is archived
  23 + And I visit dashboard projects page
  24 + Then I should see "Archived"
  25 +
  26 + Scenario: I archive project
  27 + When project "Shop" has push event
  28 + And I visit project "Shop" page
  29 + And I visit edit project "Shop" page
  30 + And I set project archived
  31 + Then I should see "Archived"
  32 +
  33 + Scenario: I unarchive project
  34 + When project "Shop" has push event
  35 + And project "Shop" is archived
  36 + And I visit project "Shop" page
  37 + And I visit edit project "Shop" page
  38 + And I set project unarchived
  39 + Then I should not see "Archived"
features/project/archived_projects.feature
@@ -1,39 +0,0 @@ @@ -1,39 +0,0 @@
1 -Feature: Project Archived  
2 - Background:  
3 - Given I sign in as a user  
4 - And I own project "Shop"  
5 - And I own project "Forum"  
6 -  
7 - Scenario: I should not see archived on project page of not-archive project  
8 - And project "Forum" is archived  
9 - And I visit project "Shop" page  
10 - Then I should not see "Archived"  
11 -  
12 - Scenario: I should see archived on project page of archive project  
13 - And project "Forum" is archived  
14 - And I visit project "Forum" page  
15 - Then I should see "Archived"  
16 -  
17 - Scenario: I should not see archived on projects page with no archived projects  
18 - And I visit dashboard projects page  
19 - Then I should not see "Archived"  
20 -  
21 - Scenario: I should see archived on projects page with archived projects  
22 - And project "Forum" is archived  
23 - And I visit dashboard projects page  
24 - Then I should see "Archived"  
25 -  
26 - Scenario: I archive project  
27 - When project "Shop" has push event  
28 - And I visit project "Shop" page  
29 - And I visit edit project "Shop" page  
30 - And I set project archived  
31 - Then I should see "Archived"  
32 -  
33 - Scenario: I unarchive project  
34 - When project "Shop" has push event  
35 - And project "Shop" is archived  
36 - And I visit project "Shop" page  
37 - And I visit edit project "Shop" page  
38 - And I set project unarchived  
39 - Then I should not see "Archived"  
features/project/commits/comments.feature 0 → 100644
@@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
  1 +Feature: Comments on commits
  2 + Background:
  3 + Given I sign in as a user
  4 + And I own project "Shop"
  5 + And I visit project commit page
  6 +
  7 + @javascript
  8 + Scenario: I can comment on a commit
  9 + Given I leave a comment like "XML attached"
  10 + Then I should see a comment saying "XML attached"
  11 +
  12 + @javascript
  13 + Scenario: I can't cancel the main form
  14 + Then I should not see the cancel comment button
  15 +
  16 + @javascript
  17 + Scenario: I can't preview without text
  18 + Given I haven't written any comment text
  19 + Then I should not see the comment preview button
  20 +
  21 + @javascript
  22 + Scenario: I can preview with text
  23 + Given I write a comment like "Nice"
  24 + Then I should see the comment preview button
  25 +
  26 + @javascript
  27 + Scenario: I preview a comment
  28 + Given I preview a comment text like "Bug fixed :smile:"
  29 + Then I should see the comment preview
  30 + And I should not see the comment text field
  31 +
  32 + @javascript
  33 + Scenario: I can edit after preview
  34 + Given I preview a comment text like "Bug fixed :smile:"
  35 + Then I should see the comment edit button
  36 +
  37 + @javascript
  38 + Scenario: I have a reset form after posting from preview
  39 + Given I preview a comment text like "Bug fixed :smile:"
  40 + And I submit the comment
  41 + Then I should see an empty comment text field
  42 + And I should not see the comment preview
  43 +
  44 + @javascript
  45 + Scenario: I can delete a comment
  46 + Given I leave a comment like "XML attached"
  47 + And I delete a comment
  48 + Then I should not see a comment saying "XML attached"
features/project/commits/commit_comments.feature
@@ -1,48 +0,0 @@ @@ -1,48 +0,0 @@
1 -Feature: Comments on commits  
2 - Background:  
3 - Given I sign in as a user  
4 - And I own project "Shop"  
5 - And I visit project commit page  
6 -  
7 - @javascript  
8 - Scenario: I can comment on a commit  
9 - Given I leave a comment like "XML attached"  
10 - Then I should see a comment saying "XML attached"  
11 -  
12 - @javascript  
13 - Scenario: I can't cancel the main form  
14 - Then I should not see the cancel comment button  
15 -  
16 - @javascript  
17 - Scenario: I can't preview without text  
18 - Given I haven't written any comment text  
19 - Then I should not see the comment preview button  
20 -  
21 - @javascript  
22 - Scenario: I can preview with text  
23 - Given I write a comment like "Nice"  
24 - Then I should see the comment preview button  
25 -  
26 - @javascript  
27 - Scenario: I preview a comment  
28 - Given I preview a comment text like "Bug fixed :smile:"  
29 - Then I should see the comment preview  
30 - And I should not see the comment text field  
31 -  
32 - @javascript  
33 - Scenario: I can edit after preview  
34 - Given I preview a comment text like "Bug fixed :smile:"  
35 - Then I should see the comment edit button  
36 -  
37 - @javascript  
38 - Scenario: I have a reset form after posting from preview  
39 - Given I preview a comment text like "Bug fixed :smile:"  
40 - And I submit the comment  
41 - Then I should see an empty comment text field  
42 - And I should not see the comment preview  
43 -  
44 - @javascript  
45 - Scenario: I can delete a comment  
46 - Given I leave a comment like "XML attached"  
47 - And I delete a comment  
48 - Then I should not see a comment saying "XML attached"  
features/project/commits/commit_diff_comments.feature
@@ -1,85 +0,0 @@ @@ -1,85 +0,0 @@
1 -Feature: Comments on commit diffs  
2 - Background:  
3 - Given I sign in as a user  
4 - And I own project "Shop"  
5 - And I visit project commit page  
6 -  
7 - @javascript  
8 - Scenario: I can access add diff comment buttons  
9 - Then I should see add a diff comment button  
10 -  
11 - @javascript  
12 - Scenario: I can comment on a commit diff  
13 - Given I leave a diff comment like "Typo, please fix"  
14 - Then I should see a diff comment saying "Typo, please fix"  
15 -  
16 - @javascript  
17 - Scenario: I get a temporary form for the first comment on a diff line  
18 - Given I open a diff comment form  
19 - Then I should see a temporary diff comment form  
20 -  
21 - @javascript  
22 - Scenario: I have a cancel button on the diff form  
23 - Given I open a diff comment form  
24 - Then I should see the cancel comment button  
25 -  
26 - @javascript  
27 - Scenario: I can cancel a diff form  
28 - Given I open a diff comment form  
29 - And I cancel the diff comment  
30 - Then I should not see the diff comment form  
31 -  
32 - @javascript  
33 - Scenario: I can't open a second form for a diff line  
34 - Given I open a diff comment form  
35 - And I open a diff comment form  
36 - Then I should only see one diff form  
37 -  
38 - @javascript  
39 - Scenario: I can have multiple forms  
40 - Given I open a diff comment form  
41 - And I write a diff comment like ":-1: I don't like this"  
42 - And I open another diff comment form  
43 - Then I should see a diff comment form with ":-1: I don't like this"  
44 - And I should see an empty diff comment form  
45 -  
46 - @javascript  
47 - Scenario: I can preview multiple forms separately  
48 - Given I preview a diff comment text like "Should fix it :smile:"  
49 - And I preview another diff comment text like "DRY this up"  
50 - Then I should see two separate previews  
51 -  
52 - @javascript  
53 - Scenario: I have a reply button in discussions  
54 - Given I leave a diff comment like "Typo, please fix"  
55 - Then I should see a discussion reply button  
56 -  
57 - @javascript  
58 - Scenario: I can't preview without text  
59 - Given I open a diff comment form  
60 - And I haven't written any diff comment text  
61 - Then I should not see the diff comment preview button  
62 -  
63 - @javascript  
64 - Scenario: I can preview with text  
65 - Given I open a diff comment form  
66 - And I write a diff comment like ":-1: I don't like this"  
67 - Then I should see the diff comment preview button  
68 -  
69 - @javascript  
70 - Scenario: I preview a diff comment  
71 - Given I preview a diff comment text like "Should fix it :smile:"  
72 - Then I should see the diff comment preview  
73 - And I should not see the diff comment text field  
74 -  
75 - @javascript  
76 - Scenario: I can edit after preview  
77 - Given I preview a diff comment text like "Should fix it :smile:"  
78 - Then I should see the diff comment edit button  
79 -  
80 - @javascript  
81 - Scenario: The form gets removed after posting  
82 - Given I preview a diff comment text like "Should fix it :smile:"  
83 - And I submit the diff comment  
84 - Then I should not see the diff comment form  
85 - And I should see a discussion reply button  
features/project/commits/commits_user_lookup.feature
@@ -1,14 +0,0 @@ @@ -1,14 +0,0 @@
1 -Feature: Project Browse Commits User Lookup  
2 - Background:  
3 - Given I sign in as a user  
4 - And I own a project  
5 - And I have the user that authored the commits  
6 - And I visit my project's commits page  
7 -  
8 - Scenario: I browse commit from list  
9 - Given I click on commit link  
10 - Then I see commit info  
11 -  
12 - Scenario: I browse another commit from list  
13 - Given I click on another commit link  
14 - Then I see other commit info  
15 \ No newline at end of file 0 \ No newline at end of file
features/project/commits/diff_comments.feature 0 → 100644
@@ -0,0 +1,85 @@ @@ -0,0 +1,85 @@
  1 +Feature: Comments on commit diffs
  2 + Background:
  3 + Given I sign in as a user
  4 + And I own project "Shop"
  5 + And I visit project commit page
  6 +
  7 + @javascript
  8 + Scenario: I can access add diff comment buttons
  9 + Then I should see add a diff comment button
  10 +
  11 + @javascript
  12 + Scenario: I can comment on a commit diff
  13 + Given I leave a diff comment like "Typo, please fix"
  14 + Then I should see a diff comment saying "Typo, please fix"
  15 +
  16 + @javascript
  17 + Scenario: I get a temporary form for the first comment on a diff line
  18 + Given I open a diff comment form
  19 + Then I should see a temporary diff comment form
  20 +
  21 + @javascript
  22 + Scenario: I have a cancel button on the diff form
  23 + Given I open a diff comment form
  24 + Then I should see the cancel comment button
  25 +
  26 + @javascript
  27 + Scenario: I can cancel a diff form
  28 + Given I open a diff comment form
  29 + And I cancel the diff comment
  30 + Then I should not see the diff comment form
  31 +
  32 + @javascript
  33 + Scenario: I can't open a second form for a diff line
  34 + Given I open a diff comment form
  35 + And I open a diff comment form
  36 + Then I should only see one diff form
  37 +
  38 + @javascript
  39 + Scenario: I can have multiple forms
  40 + Given I open a diff comment form
  41 + And I write a diff comment like ":-1: I don't like this"
  42 + And I open another diff comment form
  43 + Then I should see a diff comment form with ":-1: I don't like this"
  44 + And I should see an empty diff comment form
  45 +
  46 + @javascript
  47 + Scenario: I can preview multiple forms separately
  48 + Given I preview a diff comment text like "Should fix it :smile:"
  49 + And I preview another diff comment text like "DRY this up"
  50 + Then I should see two separate previews
  51 +
  52 + @javascript
  53 + Scenario: I have a reply button in discussions
  54 + Given I leave a diff comment like "Typo, please fix"
  55 + Then I should see a discussion reply button
  56 +
  57 + @javascript
  58 + Scenario: I can't preview without text
  59 + Given I open a diff comment form
  60 + And I haven't written any diff comment text
  61 + Then I should not see the diff comment preview button
  62 +
  63 + @javascript
  64 + Scenario: I can preview with text
  65 + Given I open a diff comment form
  66 + And I write a diff comment like ":-1: I don't like this"
  67 + Then I should see the diff comment preview button
  68 +
  69 + @javascript
  70 + Scenario: I preview a diff comment
  71 + Given I preview a diff comment text like "Should fix it :smile:"
  72 + Then I should see the diff comment preview
  73 + And I should not see the diff comment text field
  74 +
  75 + @javascript
  76 + Scenario: I can edit after preview
  77 + Given I preview a diff comment text like "Should fix it :smile:"
  78 + Then I should see the diff comment edit button
  79 +
  80 + @javascript
  81 + Scenario: The form gets removed after posting
  82 + Given I preview a diff comment text like "Should fix it :smile:"
  83 + And I submit the diff comment
  84 + Then I should not see the diff comment form
  85 + And I should see a discussion reply button
features/project/commits/user_lookup.feature 0 → 100644
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
  1 +Feature: Project Browse Commits User Lookup
  2 + Background:
  3 + Given I sign in as a user
  4 + And I own a project
  5 + And I have the user that authored the commits
  6 + And I visit my project's commits page
  7 +
  8 + Scenario: I browse commit from list
  9 + Given I click on commit link
  10 + Then I see commit info
  11 +
  12 + Scenario: I browse another commit from list
  13 + Given I click on another commit link
  14 + Then I see other commit info
0 \ No newline at end of file 15 \ No newline at end of file
features/project/create.feature 0 → 100644
@@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
  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
  12 +
  13 + @javascript
  14 + Scenario: Empty project instructions
  15 + Given I sign in as a user
  16 + When I visit new project page
  17 + And fill project form with valid data
  18 + Then I see empty project instuctions
  19 + And I click on HTTP
  20 + Then Remote url should update to http link
  21 + And If I click on SSH
  22 + Then Remote url should update to ssh link
0 \ No newline at end of file 23 \ No newline at end of file
features/project/create_project.feature
@@ -1,22 +0,0 @@ @@ -1,22 +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 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  
12 -  
13 - @javascript  
14 - Scenario: Empty project instructions  
15 - Given I sign in as a user  
16 - When I visit new project page  
17 - And fill project form with valid data  
18 - Then I see empty project instuctions  
19 - And I click on HTTP  
20 - Then Remote url should update to http link  
21 - And If I click on SSH  
22 - Then Remote url should update to ssh link  
23 \ No newline at end of file 0 \ No newline at end of file
features/project/fork.feature 0 → 100644
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
  1 +Feature: Fork Project
  2 + Background:
  3 + Given I sign in as a user
  4 + And I am a member of project "Shop"
  5 + When I visit project "Shop" page
  6 +
  7 + Scenario: User fork a project
  8 + Given I click link "Fork"
  9 + Then I should see the forked project page
  10 +
  11 + Scenario: User already has forked the project
  12 + Given I already have a project named "Shop" in my namespace
  13 + And I click link "Fork"
  14 + Then I should see a "Name has already been taken" warning
features/project/fork_project.feature
@@ -1,14 +0,0 @@ @@ -1,14 +0,0 @@
1 -Feature: Fork Project  
2 - Background:  
3 - Given I sign in as a user  
4 - And I am a member of project "Shop"  
5 - When I visit project "Shop" page  
6 -  
7 - Scenario: User fork a project  
8 - Given I click link "Fork"  
9 - Then I should see the forked project page  
10 -  
11 - Scenario: User already has forked the project  
12 - Given I already have a project named "Shop" in my namespace  
13 - And I click link "Fork"  
14 - Then I should see a "Name has already been taken" warning  
features/project/public.feature 0 → 100644
@@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
  1 +Feature: Public Projects
  2 + Background:
  3 + Given I sign in as a user
  4 +
  5 + Scenario: I should see the list of public projects
  6 + When I visit the public projects area
  7 + Then I should see the list of public projects
  8 +
features/project/public_projects.feature
@@ -1,8 +0,0 @@ @@ -1,8 +0,0 @@
1 -Feature: Public Projects  
2 - Background:  
3 - Given I sign in as a user  
4 -  
5 - Scenario: I should see the list of public projects  
6 - When I visit the public projects area  
7 - Then I should see the list of public projects  
8 -  
features/public/projects.feature 0 → 100644
@@ -0,0 +1,101 @@ @@ -0,0 +1,101 @@
  1 +Feature: Public Projects Feature
  2 + Background:
  3 + Given public project "Community"
  4 + And internal project "Internal"
  5 + And private project "Enterprise"
  6 +
  7 + Scenario: I visit public area
  8 + When I visit the public projects area
  9 + Then I should see project "Community"
  10 + And I should not see project "Internal"
  11 + And I should not see project "Enterprise"
  12 +
  13 + Scenario: I visit public project page
  14 + When I visit project "Community" page
  15 + Then I should see project "Community" home page
  16 +
  17 + Scenario: I visit internal project page
  18 + When I visit project "Internal" page
  19 + Then I should be redirected to sign in page
  20 +
  21 + Scenario: I visit private project page
  22 + When I visit project "Enterprise" page
  23 + Then I should be redirected to sign in page
  24 +
  25 + Scenario: I visit an empty public project page
  26 + Given public empty project "Empty Public Project"
  27 + When I visit empty project page
  28 + Then I should see empty public project details
  29 + And I should see empty public project details with http clone info
  30 +
  31 + Scenario: I visit an empty public project page as user
  32 + Given I sign in as a user
  33 + And public empty project "Empty Public Project"
  34 + When I visit empty project page
  35 + Then I should see empty public project details
  36 + And I should see empty public project details with ssh clone info
  37 +
  38 + Scenario: I visit public area as user
  39 + Given I sign in as a user
  40 + When I visit the public projects area
  41 + Then I should see project "Community"
  42 + And I should see project "Internal"
  43 + And I should not see project "Enterprise"
  44 +
  45 + Scenario: I visit internal project page as user
  46 + Given I sign in as a user
  47 + When I visit project "Internal" page
  48 + Then I should see project "Internal" home page
  49 +
  50 + Scenario: I visit public project page
  51 + When I visit project "Community" page
  52 + Then I should see project "Community" home page
  53 + And I should see an http link to the repository
  54 +
  55 + Scenario: I visit public project page as user
  56 + Given I sign in as a user
  57 + When I visit project "Community" page
  58 + Then I should see project "Community" home page
  59 + And I should see an ssh link to the repository
  60 +
  61 + Scenario: I visit an empty public project page
  62 + Given public empty project "Empty Public Project"
  63 + When I visit empty project page
  64 + Then I should see empty public project details
  65 +
  66 + Scenario: I visit public project issues page as a non authorized user
  67 + Given I visit project "Community" page
  68 + And I visit "Community" issues page
  69 + Then I should see list of issues for "Community" project
  70 +
  71 + Scenario: I visit public project issues page as authorized user
  72 + Given I sign in as a user
  73 + Given I visit project "Community" page
  74 + And I visit "Community" issues page
  75 + Then I should see list of issues for "Community" project
  76 +
  77 + Scenario: I visit internal project issues page as authorized user
  78 + Given I sign in as a user
  79 + Given I visit project "Internal" page
  80 + And I visit "Internal" issues page
  81 + Then I should see list of issues for "Internal" project
  82 +
  83 + Scenario: I visit public project merge requests page as an authorized user
  84 + Given I sign in as a user
  85 + Given I visit project "Community" page
  86 + And I visit "Community" merge requests page
  87 + And project "Community" has "Bug fix" open merge request
  88 + Then I should see list of merge requests for "Community" project
  89 +
  90 + Scenario: I visit public project merge requests page as a non authorized user
  91 + Given I visit project "Community" page
  92 + And I visit "Community" merge requests page
  93 + And project "Community" has "Bug fix" open merge request
  94 + Then I should see list of merge requests for "Community" project
  95 +
  96 + Scenario: I visit internal project merge requests page as an authorized user
  97 + Given I sign in as a user
  98 + Given I visit project "Internal" page
  99 + And I visit "Internal" merge requests page
  100 + And project "Internal" has "Feature implemented" open merge request
  101 + Then I should see list of merge requests for "Internal" project
features/public/public_projects.feature
@@ -1,101 +0,0 @@ @@ -1,101 +0,0 @@
1 -Feature: Public Projects Feature  
2 - Background:  
3 - Given public project "Community"  
4 - And internal project "Internal"  
5 - And private project "Enterprise"  
6 -  
7 - Scenario: I visit public area  
8 - When I visit the public projects area  
9 - Then I should see project "Community"  
10 - And I should not see project "Internal"  
11 - And I should not see project "Enterprise"  
12 -  
13 - Scenario: I visit public project page  
14 - When I visit project "Community" page  
15 - Then I should see project "Community" home page  
16 -  
17 - Scenario: I visit internal project page  
18 - When I visit project "Internal" page  
19 - Then I should be redirected to sign in page  
20 -  
21 - Scenario: I visit private project page  
22 - When I visit project "Enterprise" page  
23 - Then I should be redirected to sign in page  
24 -  
25 - Scenario: I visit an empty public project page  
26 - Given public empty project "Empty Public Project"  
27 - When I visit empty project page  
28 - Then I should see empty public project details  
29 - And I should see empty public project details with http clone info  
30 -  
31 - Scenario: I visit an empty public project page as user  
32 - Given I sign in as a user  
33 - And public empty project "Empty Public Project"  
34 - When I visit empty project page  
35 - Then I should see empty public project details  
36 - And I should see empty public project details with ssh clone info  
37 -  
38 - Scenario: I visit public area as user  
39 - Given I sign in as a user  
40 - When I visit the public projects area  
41 - Then I should see project "Community"  
42 - And I should see project "Internal"  
43 - And I should not see project "Enterprise"  
44 -  
45 - Scenario: I visit internal project page as user  
46 - Given I sign in as a user  
47 - When I visit project "Internal" page  
48 - Then I should see project "Internal" home page  
49 -  
50 - Scenario: I visit public project page  
51 - When I visit project "Community" page  
52 - Then I should see project "Community" home page  
53 - And I should see an http link to the repository  
54 -  
55 - Scenario: I visit public project page as user  
56 - Given I sign in as a user  
57 - When I visit project "Community" page  
58 - Then I should see project "Community" home page  
59 - And I should see an ssh link to the repository  
60 -  
61 - Scenario: I visit an empty public project page  
62 - Given public empty project "Empty Public Project"  
63 - When I visit empty project page  
64 - Then I should see empty public project details  
65 -  
66 - Scenario: I visit public project issues page as a non authorized user  
67 - Given I visit project "Community" page  
68 - And I visit "Community" issues page  
69 - Then I should see list of issues for "Community" project  
70 -  
71 - Scenario: I visit public project issues page as authorized user  
72 - Given I sign in as a user  
73 - Given I visit project "Community" page  
74 - And I visit "Community" issues page  
75 - Then I should see list of issues for "Community" project  
76 -  
77 - Scenario: I visit internal project issues page as authorized user  
78 - Given I sign in as a user  
79 - Given I visit project "Internal" page  
80 - And I visit "Internal" issues page  
81 - Then I should see list of issues for "Internal" project  
82 -  
83 - Scenario: I visit public project merge requests page as an authorized user  
84 - Given I sign in as a user  
85 - Given I visit project "Community" page  
86 - And I visit "Community" merge requests page  
87 - And project "Community" has "Bug fix" open merge request  
88 - Then I should see list of merge requests for "Community" project  
89 -  
90 - Scenario: I visit public project merge requests page as a non authorized user  
91 - Given I visit project "Community" page  
92 - And I visit "Community" merge requests page  
93 - And project "Community" has "Bug fix" open merge request  
94 - Then I should see list of merge requests for "Community" project  
95 -  
96 - Scenario: I visit internal project merge requests page as an authorized user  
97 - Given I sign in as a user  
98 - Given I visit project "Internal" page  
99 - And I visit "Internal" merge requests page  
100 - And project "Internal" has "Feature implemented" open merge request  
101 - Then I should see list of merge requests for "Internal" project  
features/snippets/discover.feature 0 → 100644
@@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
  1 +Feature: Discover Snippets
  2 + Background:
  3 + Given I sign in as a user
  4 + And I have public "Personal snippet one" snippet
  5 + And I have private "Personal snippet private" snippet
  6 +
  7 + Scenario: I should see snippets
  8 + Given I visit snippets page
  9 + Then I should see "Personal snippet one" in snippets
  10 + And I should not see "Personal snippet private" in snippets
features/snippets/discover_snippets.feature
@@ -1,10 +0,0 @@ @@ -1,10 +0,0 @@
1 -Feature: Discover Snippets  
2 - Background:  
3 - Given I sign in as a user  
4 - And I have public "Personal snippet one" snippet  
5 - And I have private "Personal snippet private" snippet  
6 -  
7 - Scenario: I should see snippets  
8 - Given I visit snippets page  
9 - Then I should see "Personal snippet one" in snippets  
10 - And I should not see "Personal snippet private" in snippets  
features/snippets/user.feature 0 → 100644
@@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
  1 +Feature: User Snippets
  2 + Background:
  3 + Given I sign in as a user
  4 + And I have public "Personal snippet one" snippet
  5 + And I have private "Personal snippet private" snippet
  6 +
  7 + Scenario: I should see all my snippets
  8 + Given I visit my snippets page
  9 + Then I should see "Personal snippet one" in snippets
  10 + And I should see "Personal snippet private" in snippets
  11 +
  12 + Scenario: I can see only my private snippets
  13 + Given I visit my snippets page
  14 + And I click "Private" filter
  15 + Then I should not see "Personal snippet one" in snippets
  16 + And I should see "Personal snippet private" in snippets
  17 +
  18 + Scenario: I can see only my public snippets
  19 + Given I visit my snippets page
  20 + And I click "Public" filter
  21 + Then I should see "Personal snippet one" in snippets
  22 + And I should not see "Personal snippet private" in snippets
features/snippets/user_snippets.feature
@@ -1,22 +0,0 @@ @@ -1,22 +0,0 @@
1 -Feature: User Snippets  
2 - Background:  
3 - Given I sign in as a user  
4 - And I have public "Personal snippet one" snippet  
5 - And I have private "Personal snippet private" snippet  
6 -  
7 - Scenario: I should see all my snippets  
8 - Given I visit my snippets page  
9 - Then I should see "Personal snippet one" in snippets  
10 - And I should see "Personal snippet private" in snippets  
11 -  
12 - Scenario: I can see only my private snippets  
13 - Given I visit my snippets page  
14 - And I click "Private" filter  
15 - Then I should not see "Personal snippet one" in snippets  
16 - And I should see "Personal snippet private" in snippets  
17 -  
18 - Scenario: I can see only my public snippets  
19 - Given I visit my snippets page  
20 - And I click "Public" filter  
21 - Then I should see "Personal snippet one" in snippets  
22 - And I should not see "Personal snippet private" in snippets  
features/steps/admin/active_tab.rb 0 → 100644
@@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
  1 +class AdminActiveTab < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedActiveTab
  5 +
  6 + Then 'the active main tab should be Home' do
  7 + ensure_active_main_tab('Home')
  8 + end
  9 +
  10 + Then 'the active main tab should be Projects' do
  11 + ensure_active_main_tab('Projects')
  12 + end
  13 +
  14 + Then 'the active main tab should be Groups' do
  15 + ensure_active_main_tab('Groups')
  16 + end
  17 +
  18 + Then 'the active main tab should be Users' do
  19 + ensure_active_main_tab('Users')
  20 + end
  21 +
  22 + Then 'the active main tab should be Logs' do
  23 + ensure_active_main_tab('Logs')
  24 + end
  25 +
  26 + Then 'the active main tab should be Hooks' do
  27 + ensure_active_main_tab('Hooks')
  28 + end
  29 +
  30 + Then 'the active main tab should be Resque' do
  31 + ensure_active_main_tab('Background Jobs')
  32 + end
  33 +
  34 + Then 'the active main tab should be Messages' do
  35 + ensure_active_main_tab('Messages')
  36 + end
  37 +end
features/steps/admin/admin_active_tab.rb
@@ -1,37 +0,0 @@ @@ -1,37 +0,0 @@
1 -class AdminActiveTab < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedActiveTab  
5 -  
6 - Then 'the active main tab should be Home' do  
7 - ensure_active_main_tab('Home')  
8 - end  
9 -  
10 - Then 'the active main tab should be Projects' do  
11 - ensure_active_main_tab('Projects')  
12 - end  
13 -  
14 - Then 'the active main tab should be Groups' do  
15 - ensure_active_main_tab('Groups')  
16 - end  
17 -  
18 - Then 'the active main tab should be Users' do  
19 - ensure_active_main_tab('Users')  
20 - end  
21 -  
22 - Then 'the active main tab should be Logs' do  
23 - ensure_active_main_tab('Logs')  
24 - end  
25 -  
26 - Then 'the active main tab should be Hooks' do  
27 - ensure_active_main_tab('Hooks')  
28 - end  
29 -  
30 - Then 'the active main tab should be Resque' do  
31 - ensure_active_main_tab('Background Jobs')  
32 - end  
33 -  
34 - Then 'the active main tab should be Messages' do  
35 - ensure_active_main_tab('Messages')  
36 - end  
37 -end  
features/steps/admin/admin_broadcast_messages.rb
@@ -1,41 +0,0 @@ @@ -1,41 +0,0 @@
1 -class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedAdmin  
5 -  
6 - step 'application already has admin messages' do  
7 - FactoryGirl.create(:broadcast_message, message: "Migration to new server")  
8 - end  
9 -  
10 - step 'I should be all broadcast messages' do  
11 - page.should have_content "Migration to new server"  
12 - end  
13 -  
14 - step 'submit form with new broadcast message' do  
15 - fill_in 'broadcast_message_message', with: 'Application update from 4:00 CST to 5:00 CST'  
16 - select '2018', from: "broadcast_message_ends_at_1i"  
17 - click_button "Add broadcast message"  
18 - end  
19 -  
20 - step 'I should be redirected to admin messages page' do  
21 - current_path.should == admin_broadcast_messages_path  
22 - end  
23 -  
24 - step 'I should see newly created broadcast message' do  
25 - page.should have_content 'Application update from 4:00 CST to 5:00 CST'  
26 - end  
27 -  
28 - step 'submit form with new customized broadcast message' do  
29 - fill_in 'broadcast_message_message', with: 'Application update from 4:00 CST to 5:00 CST'  
30 - click_link "Customize colors"  
31 - fill_in 'broadcast_message_color', with: '#f2dede'  
32 - fill_in 'broadcast_message_font', with: '#b94a48'  
33 - select '2018', from: "broadcast_message_ends_at_1i"  
34 - click_button "Add broadcast message"  
35 - end  
36 -  
37 - step 'I should see a customized broadcast message' do  
38 - page.should have_content 'Application update from 4:00 CST to 5:00 CST'  
39 - page.should have_selector %(div[style="background-color:#f2dede;color:#b94a48"])  
40 - end  
41 -end  
features/steps/admin/admin_groups.rb
@@ -1,66 +0,0 @@ @@ -1,66 +0,0 @@
1 -class AdminGroups < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedUser  
5 - include SharedActiveTab  
6 - include Select2Helper  
7 -  
8 - When 'I visit admin group page' do  
9 - visit admin_group_path(current_group)  
10 - end  
11 -  
12 - When 'I click new group link' do  
13 - click_link "New Group"  
14 - end  
15 -  
16 - And 'I have group with projects' do  
17 - @group = create(:group)  
18 - @project = create(:project, group: @group)  
19 - @event = create(:closed_issue_event, project: @project)  
20 -  
21 - @project.team << [current_user, :master]  
22 - end  
23 -  
24 - And 'submit form with new group info' do  
25 - fill_in 'group_name', with: 'gitlab'  
26 - fill_in 'group_description', with: 'Group description'  
27 - click_button "Create group"  
28 - end  
29 -  
30 - Then 'I should see newly created group' do  
31 - page.should have_content "Group: gitlab"  
32 - page.should have_content "Group description"  
33 - end  
34 -  
35 - Then 'I should be redirected to group page' do  
36 - current_path.should == admin_group_path(Group.last)  
37 - end  
38 -  
39 - When 'I select user "John Doe" from user list as "Reporter"' do  
40 - user = User.find_by(name: "John Doe")  
41 - select2(user.id, from: "#user_ids", multiple: true)  
42 - within "#new_team_member" do  
43 - select "Reporter", from: "group_access"  
44 - end  
45 - click_button "Add users into group"  
46 - end  
47 -  
48 - Then 'I should see "John Doe" in team list in every project as "Reporter"' do  
49 - within ".group-users-list" do  
50 - page.should have_content "John Doe"  
51 - page.should have_content "Reporter"  
52 - end  
53 - end  
54 -  
55 - step 'I should be all groups' do  
56 - Group.all.each do |group|  
57 - page.should have_content group.name  
58 - end  
59 - end  
60 -  
61 - protected  
62 -  
63 - def current_group  
64 - @group ||= Group.first  
65 - end  
66 -end  
features/steps/admin/admin_logs.rb
@@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
1 -class AdminLogs < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedAdmin  
5 -  
6 - Then 'I should see tabs with available logs' do  
7 - page.should have_content 'production.log'  
8 - page.should have_content 'githost.log'  
9 - page.should have_content 'application.log'  
10 - end  
11 -end  
features/steps/admin/admin_projects.rb
@@ -1,22 +0,0 @@ @@ -1,22 +0,0 @@
1 -class AdminProjects < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedAdmin  
5 -  
6 - And 'I should see all projects' do  
7 - Project.all.each do |p|  
8 - page.should have_content p.name_with_namespace  
9 - end  
10 - end  
11 -  
12 - And 'I click on first project' do  
13 - click_link Project.first.name_with_namespace  
14 - end  
15 -  
16 - Then 'I should see project details' do  
17 - project = Project.first  
18 - current_path.should == admin_project_path(project)  
19 - page.should have_content(project.name_with_namespace)  
20 - page.should have_content(project.creator.name)  
21 - end  
22 -end  
features/steps/admin/admin_users.rb
@@ -1,34 +0,0 @@ @@ -1,34 +0,0 @@
1 -class AdminUsers < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedAdmin  
5 -  
6 - Then 'I should see all users' do  
7 - User.all.each do |user|  
8 - page.should have_content user.name  
9 - end  
10 - end  
11 -  
12 - And 'Click edit' do  
13 - @user = User.first  
14 - find("#edit_user_#{@user.id}").click  
15 - end  
16 -  
17 - And 'Input non ascii char in username' do  
18 - fill_in 'user_username', with: "\u3042\u3044"  
19 - end  
20 -  
21 - And 'Click save' do  
22 - click_button("Save")  
23 - end  
24 -  
25 - Then 'See username error message' do  
26 - within "#error_explanation" do  
27 - page.should have_content "Username"  
28 - end  
29 - end  
30 -  
31 - And 'Not changed form action url' do  
32 - page.should have_selector %(form[action="/admin/users/#{@user.username}"])  
33 - end  
34 -end  
features/steps/admin/broadcast_messages.rb 0 → 100644
@@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
  1 +class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedAdmin
  5 +
  6 + step 'application already has admin messages' do
  7 + FactoryGirl.create(:broadcast_message, message: "Migration to new server")
  8 + end
  9 +
  10 + step 'I should be all broadcast messages' do
  11 + page.should have_content "Migration to new server"
  12 + end
  13 +
  14 + step 'submit form with new broadcast message' do
  15 + fill_in 'broadcast_message_message', with: 'Application update from 4:00 CST to 5:00 CST'
  16 + select '2018', from: "broadcast_message_ends_at_1i"
  17 + click_button "Add broadcast message"
  18 + end
  19 +
  20 + step 'I should be redirected to admin messages page' do
  21 + current_path.should == admin_broadcast_messages_path
  22 + end
  23 +
  24 + step 'I should see newly created broadcast message' do
  25 + page.should have_content 'Application update from 4:00 CST to 5:00 CST'
  26 + end
  27 +
  28 + step 'submit form with new customized broadcast message' do
  29 + fill_in 'broadcast_message_message', with: 'Application update from 4:00 CST to 5:00 CST'
  30 + click_link "Customize colors"
  31 + fill_in 'broadcast_message_color', with: '#f2dede'
  32 + fill_in 'broadcast_message_font', with: '#b94a48'
  33 + select '2018', from: "broadcast_message_ends_at_1i"
  34 + click_button "Add broadcast message"
  35 + end
  36 +
  37 + step 'I should see a customized broadcast message' do
  38 + page.should have_content 'Application update from 4:00 CST to 5:00 CST'
  39 + page.should have_selector %(div[style="background-color:#f2dede;color:#b94a48"])
  40 + end
  41 +end
features/steps/admin/groups.rb 0 → 100644
@@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
  1 +class AdminGroups < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedUser
  5 + include SharedActiveTab
  6 + include Select2Helper
  7 +
  8 + When 'I visit admin group page' do
  9 + visit admin_group_path(current_group)
  10 + end
  11 +
  12 + When 'I click new group link' do
  13 + click_link "New Group"
  14 + end
  15 +
  16 + And 'I have group with projects' do
  17 + @group = create(:group)
  18 + @project = create(:project, group: @group)
  19 + @event = create(:closed_issue_event, project: @project)
  20 +
  21 + @project.team << [current_user, :master]
  22 + end
  23 +
  24 + And 'submit form with new group info' do
  25 + fill_in 'group_name', with: 'gitlab'
  26 + fill_in 'group_description', with: 'Group description'
  27 + click_button "Create group"
  28 + end
  29 +
  30 + Then 'I should see newly created group' do
  31 + page.should have_content "Group: gitlab"
  32 + page.should have_content "Group description"
  33 + end
  34 +
  35 + Then 'I should be redirected to group page' do
  36 + current_path.should == admin_group_path(Group.last)
  37 + end
  38 +
  39 + When 'I select user "John Doe" from user list as "Reporter"' do
  40 + user = User.find_by(name: "John Doe")
  41 + select2(user.id, from: "#user_ids", multiple: true)
  42 + within "#new_team_member" do
  43 + select "Reporter", from: "group_access"
  44 + end
  45 + click_button "Add users into group"
  46 + end
  47 +
  48 + Then 'I should see "John Doe" in team list in every project as "Reporter"' do
  49 + within ".group-users-list" do
  50 + page.should have_content "John Doe"
  51 + page.should have_content "Reporter"
  52 + end
  53 + end
  54 +
  55 + step 'I should be all groups' do
  56 + Group.all.each do |group|
  57 + page.should have_content group.name
  58 + end
  59 + end
  60 +
  61 + protected
  62 +
  63 + def current_group
  64 + @group ||= Group.first
  65 + end
  66 +end
features/steps/admin/logs.rb 0 → 100644
@@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
  1 +class AdminLogs < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedAdmin
  5 +
  6 + Then 'I should see tabs with available logs' do
  7 + page.should have_content 'production.log'
  8 + page.should have_content 'githost.log'
  9 + page.should have_content 'application.log'
  10 + end
  11 +end
features/steps/admin/projects.rb 0 → 100644
@@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
  1 +class AdminProjects < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedAdmin
  5 +
  6 + And 'I should see all projects' do
  7 + Project.all.each do |p|
  8 + page.should have_content p.name_with_namespace
  9 + end
  10 + end
  11 +
  12 + And 'I click on first project' do
  13 + click_link Project.first.name_with_namespace
  14 + end
  15 +
  16 + Then 'I should see project details' do
  17 + project = Project.first
  18 + current_path.should == admin_project_path(project)
  19 + page.should have_content(project.name_with_namespace)
  20 + page.should have_content(project.creator.name)
  21 + end
  22 +end
features/steps/admin/users.rb 0 → 100644
@@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
  1 +class AdminUsers < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedAdmin
  5 +
  6 + Then 'I should see all users' do
  7 + User.all.each do |user|
  8 + page.should have_content user.name
  9 + end
  10 + end
  11 +
  12 + And 'Click edit' do
  13 + @user = User.first
  14 + find("#edit_user_#{@user.id}").click
  15 + end
  16 +
  17 + And 'Input non ascii char in username' do
  18 + fill_in 'user_username', with: "\u3042\u3044"
  19 + end
  20 +
  21 + And 'Click save' do
  22 + click_button("Save")
  23 + end
  24 +
  25 + Then 'See username error message' do
  26 + within "#error_explanation" do
  27 + page.should have_content "Username"
  28 + end
  29 + end
  30 +
  31 + And 'Not changed form action url' do
  32 + page.should have_selector %(form[action="/admin/users/#{@user.username}"])
  33 + end
  34 +end
features/steps/dashboard/active_tab.rb 0 → 100644
@@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
  1 +class DashboardActiveTab < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedActiveTab
  5 +
  6 + Then 'the active main tab should be Home' do
  7 + ensure_active_main_tab('Home')
  8 + end
  9 +
  10 + Then 'the active main tab should be Issues' do
  11 + ensure_active_main_tab('Issues')
  12 + end
  13 +
  14 + Then 'the active main tab should be Merge Requests' do
  15 + ensure_active_main_tab('Merge Requests')
  16 + end
  17 +
  18 + Then 'the active main tab should be Help' do
  19 + ensure_active_main_tab('Help')
  20 + end
  21 +end
features/steps/dashboard/dashboard_active_tab.rb
@@ -1,21 +0,0 @@ @@ -1,21 +0,0 @@
1 -class DashboardActiveTab < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedActiveTab  
5 -  
6 - Then 'the active main tab should be Home' do  
7 - ensure_active_main_tab('Home')  
8 - end  
9 -  
10 - Then 'the active main tab should be Issues' do  
11 - ensure_active_main_tab('Issues')  
12 - end  
13 -  
14 - Then 'the active main tab should be Merge Requests' do  
15 - ensure_active_main_tab('Merge Requests')  
16 - end  
17 -  
18 - Then 'the active main tab should be Help' do  
19 - ensure_active_main_tab('Help')  
20 - end  
21 -end  
features/steps/dashboard/dashboard_event_filters.rb
@@ -1,87 +0,0 @@ @@ -1,87 +0,0 @@
1 -class EventFilters < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedProject  
5 -  
6 - Then 'I should see push event' do  
7 - page.should have_selector('span.pushed')  
8 - end  
9 -  
10 - Then 'I should not see push event' do  
11 - page.should_not have_selector('span.pushed')  
12 - end  
13 -  
14 - Then 'I should see new member event' do  
15 - page.should have_selector('span.joined')  
16 - end  
17 -  
18 - And 'I should not see new member event' do  
19 - page.should_not have_selector('span.joined')  
20 - end  
21 -  
22 - Then 'I should see merge request event' do  
23 - page.should have_selector('span.accepted')  
24 - end  
25 -  
26 - And 'I should not see merge request event' do  
27 - page.should_not have_selector('span.accepted')  
28 - end  
29 -  
30 - And 'this project has push event' do  
31 - data = {  
32 - before: "0000000000000000000000000000000000000000",  
33 - after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",  
34 - ref: "refs/heads/new_design",  
35 - user_id: @user.id,  
36 - user_name: @user.name,  
37 - repository: {  
38 - name: @project.name,  
39 - url: "localhost/rubinius",  
40 - description: "",  
41 - homepage: "localhost/rubinius",  
42 - private: true  
43 - }  
44 - }  
45 -  
46 - @event = Event.create(  
47 - project: @project,  
48 - action: Event::PUSHED,  
49 - data: data,  
50 - author_id: @user.id  
51 - )  
52 - end  
53 -  
54 - And 'this project has new member event' do  
55 - user = create(:user, {name: "John Doe"})  
56 - Event.create(  
57 - project: @project,  
58 - author_id: user.id,  
59 - action: Event::JOINED  
60 - )  
61 - end  
62 -  
63 - And 'this project has merge request event' do  
64 - merge_request = create :merge_request, author: @user, source_project: @project, target_project: @project  
65 - Event.create(  
66 - project: @project,  
67 - action: Event::MERGED,  
68 - target_id: merge_request.id,  
69 - target_type: "MergeRequest",  
70 - author_id: @user.id  
71 - )  
72 - end  
73 -  
74 - When 'I click "push" event filter' do  
75 - click_link("push_event_filter")  
76 - end  
77 -  
78 - When 'I click "team" event filter' do  
79 - click_link("team_event_filter")  
80 - end  
81 -  
82 - When 'I click "merge" event filter' do  
83 - click_link("merged_event_filter")  
84 - end  
85 -  
86 -end  
87 -  
features/steps/dashboard/dashboard_issues.rb
@@ -1,74 +0,0 @@ @@ -1,74 +0,0 @@
1 -class DashboardIssues < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 -  
5 - step 'I should see issues assigned to me' do  
6 - should_see(assigned_issue)  
7 - should_not_see(authored_issue)  
8 - should_not_see(other_issue)  
9 - end  
10 -  
11 - step 'I should see issues authored by me' do  
12 - should_see(authored_issue)  
13 - should_not_see(assigned_issue)  
14 - should_not_see(other_issue)  
15 - end  
16 -  
17 - step 'I should see all issues' do  
18 - should_see(authored_issue)  
19 - should_see(assigned_issue)  
20 - should_see(other_issue)  
21 - end  
22 -  
23 - step 'I have authored issues' do  
24 - authored_issue  
25 - end  
26 -  
27 - step 'I have assigned issues' do  
28 - assigned_issue  
29 - end  
30 -  
31 - step 'I have other issues' do  
32 - other_issue  
33 - end  
34 -  
35 - step 'I click "Authored by me" link' do  
36 - within ".scope-filter" do  
37 - click_link 'Created by me'  
38 - end  
39 - end  
40 -  
41 - step 'I click "All" link' do  
42 - within ".scope-filter" do  
43 - click_link "Everyone's"  
44 - end  
45 - end  
46 -  
47 - def should_see(issue)  
48 - page.should have_content(issue.title[0..10])  
49 - end  
50 -  
51 - def should_not_see(issue)  
52 - page.should_not have_content(issue.title[0..10])  
53 - end  
54 -  
55 - def assigned_issue  
56 - @assigned_issue ||= create :issue, assignee: current_user, project: project  
57 - end  
58 -  
59 - def authored_issue  
60 - @authored_issue ||= create :issue, author: current_user, project: project  
61 - end  
62 -  
63 - def other_issue  
64 - @other_issue ||= create :issue, project: project  
65 - end  
66 -  
67 - def project  
68 - @project ||= begin  
69 - project =create :project  
70 - project.team << [current_user, :master]  
71 - project  
72 - end  
73 - end  
74 -end  
features/steps/dashboard/dashboard_merge_requests.rb
@@ -1,74 +0,0 @@ @@ -1,74 +0,0 @@
1 -class DashboardMergeRequests < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 -  
5 - step 'I should see merge requests assigned to me' do  
6 - should_see(assigned_merge_request)  
7 - should_not_see(authored_merge_request)  
8 - should_not_see(other_merge_request)  
9 - end  
10 -  
11 - step 'I should see merge requests authored by me' do  
12 - should_see(authored_merge_request)  
13 - should_not_see(assigned_merge_request)  
14 - should_not_see(other_merge_request)  
15 - end  
16 -  
17 - step 'I should see all merge requests' do  
18 - should_see(authored_merge_request)  
19 - should_see(assigned_merge_request)  
20 - should_see(other_merge_request)  
21 - end  
22 -  
23 - step 'I have authored merge requests' do  
24 - authored_merge_request  
25 - end  
26 -  
27 - step 'I have assigned merge requests' do  
28 - assigned_merge_request  
29 - end  
30 -  
31 - step 'I have other merge requests' do  
32 - other_merge_request  
33 - end  
34 -  
35 - step 'I click "Authored by me" link' do  
36 - within ".scope-filter" do  
37 - click_link 'Created by me'  
38 - end  
39 - end  
40 -  
41 - step 'I click "All" link' do  
42 - within ".scope-filter" do  
43 - click_link "Everyone's"  
44 - end  
45 - end  
46 -  
47 - def should_see(merge_request)  
48 - page.should have_content(merge_request.title[0..10])  
49 - end  
50 -  
51 - def should_not_see(merge_request)  
52 - page.should_not have_content(merge_request.title[0..10])  
53 - end  
54 -  
55 - def assigned_merge_request  
56 - @assigned_merge_request ||= create :merge_request, assignee: current_user, target_project: project  
57 - end  
58 -  
59 - def authored_merge_request  
60 - @authored_merge_request ||= create :merge_request, author: current_user, target_project: project  
61 - end  
62 -  
63 - def other_merge_request  
64 - @other_merge_request ||= create :merge_request, target_project: project  
65 - end  
66 -  
67 - def project  
68 - @project ||= begin  
69 - project =create :project  
70 - project.team << [current_user, :master]  
71 - project  
72 - end  
73 - end  
74 -end  
features/steps/dashboard/dashboard_projects.rb
@@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
1 -class DashboardProjects < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedProject  
5 -  
6 - Then 'I should see projects list' do  
7 - @user.authorized_projects.all.each do |project|  
8 - page.should have_link project.name_with_namespace  
9 - end  
10 - end  
11 -end  
features/steps/dashboard/dashboard_search.rb
@@ -1,19 +0,0 @@ @@ -1,19 +0,0 @@
1 -class DashboardSearch < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedProject  
5 -  
6 - Given 'I search for "Sho"' do  
7 - fill_in "dashboard_search", with: "Sho"  
8 - click_button "Search"  
9 - end  
10 -  
11 - Then 'I should see "Shop" project link' do  
12 - page.should have_link "Shop"  
13 - end  
14 -  
15 - Given 'I search for "Contibuting"' do  
16 - fill_in "dashboard_search", with: "Contibuting"  
17 - click_button "Search"  
18 - end  
19 -end  
features/steps/dashboard/dashboard_with_archived_projects.rb
@@ -1,22 +0,0 @@ @@ -1,22 +0,0 @@
1 -class DashboardWithArchivedProjects < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedProject  
5 -  
6 - When 'project "Forum" is archived' do  
7 - project = Project.find_by(name: "Forum")  
8 - project.update_attribute(:archived, true)  
9 - end  
10 -  
11 - Then 'I should see "Shop" project link' do  
12 - page.should have_link "Shop"  
13 - end  
14 -  
15 - Then 'I should not see "Forum" project link' do  
16 - page.should_not have_link "Forum"  
17 - end  
18 -  
19 - Then 'I should see "Forum" project link' do  
20 - page.should have_link "Forum"  
21 - end  
22 -end  
features/steps/dashboard/event_filters.rb 0 → 100644
@@ -0,0 +1,87 @@ @@ -0,0 +1,87 @@
  1 +class EventFilters < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedProject
  5 +
  6 + Then 'I should see push event' do
  7 + page.should have_selector('span.pushed')
  8 + end
  9 +
  10 + Then 'I should not see push event' do
  11 + page.should_not have_selector('span.pushed')
  12 + end
  13 +
  14 + Then 'I should see new member event' do
  15 + page.should have_selector('span.joined')
  16 + end
  17 +
  18 + And 'I should not see new member event' do
  19 + page.should_not have_selector('span.joined')
  20 + end
  21 +
  22 + Then 'I should see merge request event' do
  23 + page.should have_selector('span.accepted')
  24 + end
  25 +
  26 + And 'I should not see merge request event' do
  27 + page.should_not have_selector('span.accepted')
  28 + end
  29 +
  30 + And 'this project has push event' do
  31 + data = {
  32 + before: "0000000000000000000000000000000000000000",
  33 + after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
  34 + ref: "refs/heads/new_design",
  35 + user_id: @user.id,
  36 + user_name: @user.name,
  37 + repository: {
  38 + name: @project.name,
  39 + url: "localhost/rubinius",
  40 + description: "",
  41 + homepage: "localhost/rubinius",
  42 + private: true
  43 + }
  44 + }
  45 +
  46 + @event = Event.create(
  47 + project: @project,
  48 + action: Event::PUSHED,
  49 + data: data,
  50 + author_id: @user.id
  51 + )
  52 + end
  53 +
  54 + And 'this project has new member event' do
  55 + user = create(:user, {name: "John Doe"})
  56 + Event.create(
  57 + project: @project,
  58 + author_id: user.id,
  59 + action: Event::JOINED
  60 + )
  61 + end
  62 +
  63 + And 'this project has merge request event' do
  64 + merge_request = create :merge_request, author: @user, source_project: @project, target_project: @project
  65 + Event.create(
  66 + project: @project,
  67 + action: Event::MERGED,
  68 + target_id: merge_request.id,
  69 + target_type: "MergeRequest",
  70 + author_id: @user.id
  71 + )
  72 + end
  73 +
  74 + When 'I click "push" event filter' do
  75 + click_link("push_event_filter")
  76 + end
  77 +
  78 + When 'I click "team" event filter' do
  79 + click_link("team_event_filter")
  80 + end
  81 +
  82 + When 'I click "merge" event filter' do
  83 + click_link("merged_event_filter")
  84 + end
  85 +
  86 +end
  87 +
features/steps/dashboard/issues.rb 0 → 100644
@@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
  1 +class DashboardIssues < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 +
  5 + step 'I should see issues assigned to me' do
  6 + should_see(assigned_issue)
  7 + should_not_see(authored_issue)
  8 + should_not_see(other_issue)
  9 + end
  10 +
  11 + step 'I should see issues authored by me' do
  12 + should_see(authored_issue)
  13 + should_not_see(assigned_issue)
  14 + should_not_see(other_issue)
  15 + end
  16 +
  17 + step 'I should see all issues' do
  18 + should_see(authored_issue)
  19 + should_see(assigned_issue)
  20 + should_see(other_issue)
  21 + end
  22 +
  23 + step 'I have authored issues' do
  24 + authored_issue
  25 + end
  26 +
  27 + step 'I have assigned issues' do
  28 + assigned_issue
  29 + end
  30 +
  31 + step 'I have other issues' do
  32 + other_issue
  33 + end
  34 +
  35 + step 'I click "Authored by me" link' do
  36 + within ".scope-filter" do
  37 + click_link 'Created by me'
  38 + end
  39 + end
  40 +
  41 + step 'I click "All" link' do
  42 + within ".scope-filter" do
  43 + click_link "Everyone's"
  44 + end
  45 + end
  46 +
  47 + def should_see(issue)
  48 + page.should have_content(issue.title[0..10])
  49 + end
  50 +
  51 + def should_not_see(issue)
  52 + page.should_not have_content(issue.title[0..10])
  53 + end
  54 +
  55 + def assigned_issue
  56 + @assigned_issue ||= create :issue, assignee: current_user, project: project
  57 + end
  58 +
  59 + def authored_issue
  60 + @authored_issue ||= create :issue, author: current_user, project: project
  61 + end
  62 +
  63 + def other_issue
  64 + @other_issue ||= create :issue, project: project
  65 + end
  66 +
  67 + def project
  68 + @project ||= begin
  69 + project =create :project
  70 + project.team << [current_user, :master]
  71 + project
  72 + end
  73 + end
  74 +end
features/steps/dashboard/merge_requests.rb 0 → 100644
@@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
  1 +class DashboardMergeRequests < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 +
  5 + step 'I should see merge requests assigned to me' do
  6 + should_see(assigned_merge_request)
  7 + should_not_see(authored_merge_request)
  8 + should_not_see(other_merge_request)
  9 + end
  10 +
  11 + step 'I should see merge requests authored by me' do
  12 + should_see(authored_merge_request)
  13 + should_not_see(assigned_merge_request)
  14 + should_not_see(other_merge_request)
  15 + end
  16 +
  17 + step 'I should see all merge requests' do
  18 + should_see(authored_merge_request)
  19 + should_see(assigned_merge_request)
  20 + should_see(other_merge_request)
  21 + end
  22 +
  23 + step 'I have authored merge requests' do
  24 + authored_merge_request
  25 + end
  26 +
  27 + step 'I have assigned merge requests' do
  28 + assigned_merge_request
  29 + end
  30 +
  31 + step 'I have other merge requests' do
  32 + other_merge_request
  33 + end
  34 +
  35 + step 'I click "Authored by me" link' do
  36 + within ".scope-filter" do
  37 + click_link 'Created by me'
  38 + end
  39 + end
  40 +
  41 + step 'I click "All" link' do
  42 + within ".scope-filter" do
  43 + click_link "Everyone's"
  44 + end
  45 + end
  46 +
  47 + def should_see(merge_request)
  48 + page.should have_content(merge_request.title[0..10])
  49 + end
  50 +
  51 + def should_not_see(merge_request)
  52 + page.should_not have_content(merge_request.title[0..10])
  53 + end
  54 +
  55 + def assigned_merge_request
  56 + @assigned_merge_request ||= create :merge_request, assignee: current_user, target_project: project
  57 + end
  58 +
  59 + def authored_merge_request
  60 + @authored_merge_request ||= create :merge_request, author: current_user, target_project: project
  61 + end
  62 +
  63 + def other_merge_request
  64 + @other_merge_request ||= create :merge_request, target_project: project
  65 + end
  66 +
  67 + def project
  68 + @project ||= begin
  69 + project =create :project
  70 + project.team << [current_user, :master]
  71 + project
  72 + end
  73 + end
  74 +end
features/steps/dashboard/projects.rb 0 → 100644
@@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
  1 +class DashboardProjects < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedProject
  5 +
  6 + Then 'I should see projects list' do
  7 + @user.authorized_projects.all.each do |project|
  8 + page.should have_link project.name_with_namespace
  9 + end
  10 + end
  11 +end
features/steps/dashboard/search.rb 0 → 100644
@@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
  1 +class DashboardSearch < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedProject
  5 +
  6 + Given 'I search for "Sho"' do
  7 + fill_in "dashboard_search", with: "Sho"
  8 + click_button "Search"
  9 + end
  10 +
  11 + Then 'I should see "Shop" project link' do
  12 + page.should have_link "Shop"
  13 + end
  14 +
  15 + Given 'I search for "Contibuting"' do
  16 + fill_in "dashboard_search", with: "Contibuting"
  17 + click_button "Search"
  18 + end
  19 +end
features/steps/dashboard/with_archived_projects.rb 0 → 100644
@@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
  1 +class DashboardWithArchivedProjects < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedProject
  5 +
  6 + When 'project "Forum" is archived' do
  7 + project = Project.find_by(name: "Forum")
  8 + project.update_attribute(:archived, true)
  9 + end
  10 +
  11 + Then 'I should see "Shop" project link' do
  12 + page.should have_link "Shop"
  13 + end
  14 +
  15 + Then 'I should not see "Forum" project link' do
  16 + page.should_not have_link "Forum"
  17 + end
  18 +
  19 + Then 'I should see "Forum" project link' do
  20 + page.should have_link "Forum"
  21 + end
  22 +end
features/steps/profile/active_tab.rb 0 → 100644
@@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
  1 +class ProfileActiveTab < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedActiveTab
  5 +
  6 + Then 'the active main tab should be Home' do
  7 + ensure_active_main_tab('Home')
  8 + end
  9 +
  10 + Then 'the active main tab should be Account' do
  11 + ensure_active_main_tab('Account')
  12 + end
  13 +
  14 + Then 'the active main tab should be SSH Keys' do
  15 + ensure_active_main_tab('SSH Keys')
  16 + end
  17 +
  18 + Then 'the active main tab should be Design' do
  19 + ensure_active_main_tab('Design')
  20 + end
  21 +
  22 + Then 'the active main tab should be History' do
  23 + ensure_active_main_tab('History')
  24 + end
  25 +end
features/steps/profile/emails.rb 0 → 100644
@@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
  1 +class ProfileEmails < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 +
  4 + Then 'I visit profile emails page' do
  5 + visit profile_emails_path
  6 + end
  7 +
  8 + Then 'I should see my emails' do
  9 + page.should have_content(@user.email)
  10 + @user.emails.each do |email|
  11 + page.should have_content(email.email)
  12 + end
  13 + end
  14 +
  15 + And 'I submit new email "my@email.com"' do
  16 + fill_in "email_email", with: "my@email.com"
  17 + click_button "Add"
  18 + end
  19 +
  20 + Then 'I should see new email "my@email.com"' do
  21 + email = @user.emails.find_by(email: "my@email.com")
  22 + email.should_not be_nil
  23 + page.should have_content("my@email.com")
  24 + end
  25 +
  26 + Then 'I should not see email "my@email.com"' do
  27 + email = @user.emails.find_by(email: "my@email.com")
  28 + email.should be_nil
  29 + page.should_not have_content("my@email.com")
  30 + end
  31 +
  32 + Then 'I click link "Remove" for "my@email.com"' do
  33 + # there should only be one remove button at this time
  34 + click_link "Remove"
  35 + # force these to reload as they have been cached
  36 + @user.emails.reload
  37 + end
  38 +
  39 + And 'I submit duplicate email @user.email' do
  40 + fill_in "email_email", with: @user.email
  41 + click_button "Add"
  42 + end
  43 +
  44 + Then 'I should not have @user.email added' do
  45 + email = @user.emails.find_by(email: @user.email)
  46 + email.should be_nil
  47 + end
  48 +end
features/steps/profile/notifications.rb 0 → 100644
@@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
  1 +class ProfileNotifications < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 +
  5 + step 'I visit profile notifications page' do
  6 + visit profile_notifications_path
  7 + end
  8 +
  9 + step 'I should see global notifications settings' do
  10 + page.should have_content "Notifications settings"
  11 + end
  12 +end
features/steps/profile/profile_active_tab.rb
@@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
1 -class ProfileActiveTab < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedActiveTab  
5 -  
6 - Then 'the active main tab should be Home' do  
7 - ensure_active_main_tab('Home')  
8 - end  
9 -  
10 - Then 'the active main tab should be Account' do  
11 - ensure_active_main_tab('Account')  
12 - end  
13 -  
14 - Then 'the active main tab should be SSH Keys' do  
15 - ensure_active_main_tab('SSH Keys')  
16 - end  
17 -  
18 - Then 'the active main tab should be Design' do  
19 - ensure_active_main_tab('Design')  
20 - end  
21 -  
22 - Then 'the active main tab should be History' do  
23 - ensure_active_main_tab('History')  
24 - end  
25 -end  
features/steps/profile/profile_emails.rb
@@ -1,48 +0,0 @@ @@ -1,48 +0,0 @@
1 -class ProfileEmails < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 -  
4 - Then 'I visit profile emails page' do  
5 - visit profile_emails_path  
6 - end  
7 -  
8 - Then 'I should see my emails' do  
9 - page.should have_content(@user.email)  
10 - @user.emails.each do |email|  
11 - page.should have_content(email.email)  
12 - end  
13 - end  
14 -  
15 - And 'I submit new email "my@email.com"' do  
16 - fill_in "email_email", with: "my@email.com"  
17 - click_button "Add"  
18 - end  
19 -  
20 - Then 'I should see new email "my@email.com"' do  
21 - email = @user.emails.find_by(email: "my@email.com")  
22 - email.should_not be_nil  
23 - page.should have_content("my@email.com")  
24 - end  
25 -  
26 - Then 'I should not see email "my@email.com"' do  
27 - email = @user.emails.find_by(email: "my@email.com")  
28 - email.should be_nil  
29 - page.should_not have_content("my@email.com")  
30 - end  
31 -  
32 - Then 'I click link "Remove" for "my@email.com"' do  
33 - # there should only be one remove button at this time  
34 - click_link "Remove"  
35 - # force these to reload as they have been cached  
36 - @user.emails.reload  
37 - end  
38 -  
39 - And 'I submit duplicate email @user.email' do  
40 - fill_in "email_email", with: @user.email  
41 - click_button "Add"  
42 - end  
43 -  
44 - Then 'I should not have @user.email added' do  
45 - email = @user.emails.find_by(email: @user.email)  
46 - email.should be_nil  
47 - end  
48 -end  
features/steps/profile/profile_notifications.rb
@@ -1,12 +0,0 @@ @@ -1,12 +0,0 @@
1 -class ProfileNotifications < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 -  
5 - step 'I visit profile notifications page' do  
6 - visit profile_notifications_path  
7 - end  
8 -  
9 - step 'I should see global notifications settings' do  
10 - page.should have_content "Notifications settings"  
11 - end  
12 -end  
features/steps/profile/profile_ssh_keys.rb
@@ -1,48 +0,0 @@ @@ -1,48 +0,0 @@
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 SSH Key"  
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 AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop"  
17 - click_button "Add key"  
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 == profile_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 profile_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 - create(:key, user: @user, title: "ssh-rsa Work", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+L3TbFegm3k8QjejSwemk4HhlRh+DuN679Pc5ckqE/MPhVtE/+kZQDYCTB284GiT2aIoGzmZ8ee9TkaoejAsBwlA+Wz2Q3vhz65X6sMgalRwpdJx8kSEUYV8ZPV3MZvPo8KdNg993o4jL6G36GDW4BPIyO6FPZhfsawdf6liVD0Xo5kibIK7B9VoE178cdLQtLpS2YolRwf5yy6XR6hbbBGQR+6xrGOdP16eGZDb1CE2bMvvJijjloFqPscGktWOqW+nfh5txwFfBzlfARDTBsS8WZtg3Yoj1kn33kPsWRlgHfNutFRAIynDuDdQzQq8tTtVwm+Yi75RfcPHW8y3P Work")  
47 - end  
48 -end  
features/steps/profile/ssh_keys.rb 0 → 100644
@@ -0,0 +1,48 @@ @@ -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 SSH Key"
  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 AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop"
  17 + click_button "Add key"
  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 == profile_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 profile_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 + create(:key, user: @user, title: "ssh-rsa Work", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+L3TbFegm3k8QjejSwemk4HhlRh+DuN679Pc5ckqE/MPhVtE/+kZQDYCTB284GiT2aIoGzmZ8ee9TkaoejAsBwlA+Wz2Q3vhz65X6sMgalRwpdJx8kSEUYV8ZPV3MZvPo8KdNg993o4jL6G36GDW4BPIyO6FPZhfsawdf6liVD0Xo5kibIK7B9VoE178cdLQtLpS2YolRwf5yy6XR6hbbBGQR+6xrGOdP16eGZDb1CE2bMvvJijjloFqPscGktWOqW+nfh5txwFfBzlfARDTBsS8WZtg3Yoj1kn33kPsWRlgHfNutFRAIynDuDdQzQq8tTtVwm+Yi75RfcPHW8y3P Work")
  47 + end
  48 +end
features/steps/project/active_tab.rb 0 → 100644
@@ -0,0 +1,140 @@ @@ -0,0 +1,140 @@
  1 +class ProjectActiveTab < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedProject
  5 + include SharedActiveTab
  6 +
  7 + # Main Tabs
  8 +
  9 + Then 'the active main tab should be Home' do
  10 + ensure_active_main_tab('Home')
  11 + end
  12 +
  13 + Then 'the active main tab should be Settings' do
  14 + ensure_active_main_tab('Settings')
  15 + end
  16 +
  17 + Then 'the active main tab should be Files' do
  18 + ensure_active_main_tab('Files')
  19 + end
  20 +
  21 + Then 'the active main tab should be Commits' do
  22 + ensure_active_main_tab('Commits')
  23 + end
  24 +
  25 + Then 'the active main tab should be Network' do
  26 + ensure_active_main_tab('Network')
  27 + end
  28 +
  29 + Then 'the active main tab should be Issues' do
  30 + ensure_active_main_tab('Issues')
  31 + end
  32 +
  33 + Then 'the active main tab should be Merge Requests' do
  34 + ensure_active_main_tab('Merge Requests')
  35 + end
  36 +
  37 + Then 'the active main tab should be Wall' do
  38 + ensure_active_main_tab('Wall')
  39 + end
  40 +
  41 + Then 'the active main tab should be Wiki' do
  42 + ensure_active_main_tab('Wiki')
  43 + end
  44 +
  45 + # Sub Tabs: Home
  46 +
  47 + Given 'I click the "Team" tab' do
  48 + click_link('Members')
  49 + end
  50 +
  51 + Given 'I click the "Attachments" tab' do
  52 + click_link('Attachments')
  53 + end
  54 +
  55 + Given 'I click the "Snippets" tab' do
  56 + click_link('Snippets')
  57 + end
  58 +
  59 + Given 'I click the "Edit" tab' do
  60 + within '.project-settings-nav' do
  61 + click_link('Project')
  62 + end
  63 + end
  64 +
  65 + Given 'I click the "Hooks" tab' do
  66 + click_link('Web Hooks')
  67 + end
  68 +
  69 + Given 'I click the "Deploy Keys" tab' do
  70 + click_link('Deploy Keys')
  71 + end
  72 +
  73 + Then 'the active sub nav should be Team' do
  74 + ensure_active_sub_nav('Members')
  75 + end
  76 +
  77 + Then 'the active sub nav should be Edit' do
  78 + ensure_active_sub_nav('Project')
  79 + end
  80 +
  81 + Then 'the active sub nav should be Hooks' do
  82 + ensure_active_sub_nav('Web Hooks')
  83 + end
  84 +
  85 + Then 'the active sub nav should be Deploy Keys' do
  86 + ensure_active_sub_nav('Deploy Keys')
  87 + end
  88 +
  89 + # Sub Tabs: Commits
  90 +
  91 + Given 'I click the "Compare" tab' do
  92 + click_link('Compare')
  93 + end
  94 +
  95 + Given 'I click the "Branches" tab' do
  96 + click_link('Branches')
  97 + end
  98 +
  99 + Given 'I click the "Tags" tab' do
  100 + click_link('Tags')
  101 + end
  102 +
  103 + Then 'the active sub tab should be Commits' do
  104 + ensure_active_sub_tab('Commits')
  105 + end
  106 +
  107 + Then 'the active sub tab should be Compare' do
  108 + ensure_active_sub_tab('Compare')
  109 + end
  110 +
  111 + Then 'the active sub tab should be Branches' do
  112 + ensure_active_sub_tab('Branches')
  113 + end
  114 +
  115 + Then 'the active sub tab should be Tags' do
  116 + ensure_active_sub_tab('Tags')
  117 + end
  118 +
  119 + # Sub Tabs: Issues
  120 +
  121 + Given 'I click the "Milestones" tab' do
  122 + click_link('Milestones')
  123 + end
  124 +
  125 + Given 'I click the "Labels" tab' do
  126 + click_link('Labels')
  127 + end
  128 +
  129 + Then 'the active sub tab should be Browse Issues' do
  130 + ensure_active_sub_tab('Browse Issues')
  131 + end
  132 +
  133 + Then 'the active sub tab should be Milestones' do
  134 + ensure_active_sub_tab('Milestones')
  135 + end
  136 +
  137 + Then 'the active sub tab should be Labels' do
  138 + ensure_active_sub_tab('Labels')
  139 + end
  140 +end
features/steps/project/archived.rb 0 → 100644
@@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
  1 +class ProjectArchived < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 +
  6 + When 'project "Forum" is archived' do
  7 + project = Project.find_by(name: "Forum")
  8 + project.update_attribute(:archived, true)
  9 + end
  10 +
  11 + When 'project "Shop" is archived' do
  12 + project = Project.find_by(name: "Shop")
  13 + project.update_attribute(:archived, true)
  14 + end
  15 +
  16 + When 'I visit project "Forum" page' do
  17 + project = Project.find_by(name: "Forum")
  18 + visit project_path(project)
  19 + end
  20 +
  21 + Then 'I should not see "Archived"' do
  22 + page.should_not have_content "Archived"
  23 + end
  24 +
  25 + Then 'I should see "Archived"' do
  26 + page.should have_content "Archived"
  27 + end
  28 +
  29 + When 'I set project archived' do
  30 + click_link "Archive"
  31 + end
  32 +
  33 + When 'I set project unarchived' do
  34 + click_link "Unarchive"
  35 + end
  36 +
  37 +end
0 \ No newline at end of file 38 \ No newline at end of file
features/steps/project/browse_branches.rb 0 → 100644
@@ -0,0 +1,35 @@ @@ -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 ".protected-branches-list" 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
features/steps/project/browse_commits.rb 0 → 100644
@@ -0,0 +1,104 @@ @@ -0,0 +1,104 @@
  1 +class ProjectBrowseCommits < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 +
  6 + Then 'I see project commits' do
  7 + commit = @project.repository.commit
  8 + page.should have_content(@project.name)
  9 + page.should have_content(commit.message)
  10 + page.should have_content(commit.id.to_s[0..5])
  11 + end
  12 +
  13 + Given 'I click atom feed link' do
  14 + click_link "Feed"
  15 + end
  16 +
  17 + Then 'I see commits atom feed' do
  18 + commit = @project.repository.commit
  19 + page.response_headers['Content-Type'].should have_content("application/atom+xml")
  20 + page.body.should have_selector("title", text: "Recent commits to #{@project.name}")
  21 + page.body.should have_selector("author email", text: commit.author_email)
  22 + page.body.should have_selector("entry summary", text: commit.description)
  23 + end
  24 +
  25 + Given 'I click on commit link' do
  26 + visit project_commit_path(@project, ValidCommit::ID)
  27 + end
  28 +
  29 + Then 'I see commit info' do
  30 + page.should have_content ValidCommit::MESSAGE
  31 + page.should have_content "Showing 1 changed file"
  32 + end
  33 +
  34 + And 'I fill compare fields with refs' do
  35 + fill_in "from", with: "8716fc78f3c65bbf7bcf7b574febd583bc5d2812"
  36 + fill_in "to", with: "bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a"
  37 + click_button "Compare"
  38 + end
  39 +
  40 + Then 'I see compared refs' do
  41 + page.should have_content "Compare View"
  42 + page.should have_content "Commits (1)"
  43 + page.should have_content "Showing 2 changed files"
  44 + end
  45 +
  46 + Then 'I see breadcrumb links' do
  47 + page.should have_selector('ul.breadcrumb')
  48 + page.should have_selector('ul.breadcrumb span.divider', count: 3)
  49 + page.should have_selector('ul.breadcrumb a', count: 4)
  50 +
  51 + find('ul.breadcrumb li:nth-child(2) a')['href'].should match(/#{@project.path_with_namespace}\/commits\/master\z/)
  52 + find('ul.breadcrumb li:last a')['href'].should match(%r{master/app/models/project\.rb\z})
  53 + end
  54 +
  55 + Then 'I see commits stats' do
  56 + page.should have_content 'Top 50 Committers'
  57 + page.should have_content 'Committers'
  58 + page.should have_content 'Total commits'
  59 + page.should have_content 'Authors'
  60 + end
  61 +
  62 + Given 'I visit big commit page' do
  63 + visit project_commit_path(@project, BigCommits::BIG_COMMIT_ID)
  64 + end
  65 +
  66 + Then 'I see big commit warning' do
  67 + page.should have_content BigCommits::BIG_COMMIT_MESSAGE
  68 + page.should have_content "Warning! This is a large diff"
  69 + page.should have_content "If you still want to see the diff"
  70 + end
  71 +
  72 + Given 'I visit huge commit page' do
  73 + visit project_commit_path(@project, BigCommits::HUGE_COMMIT_ID)
  74 + end
  75 +
  76 + Then 'I see huge commit message' do
  77 + page.should have_content BigCommits::HUGE_COMMIT_MESSAGE
  78 + page.should have_content "Warning! This is a large diff"
  79 + page.should_not have_content "If you still want to see the diff"
  80 + end
  81 +
  82 + Given 'I visit a commit with an image that changed' do
  83 + visit project_commit_path(@project, 'cc1ba255d6c5ffdce87a357ba7ccc397a4f4026b')
  84 + end
  85 +
  86 + Then 'The diff links to both the previous and current image' do
  87 + links = page.all('.two-up span div a')
  88 + links[0]['href'].should =~ %r{blob/bc3735004cb45cec5e0e4fa92710897a910a5957}
  89 + links[1]['href'].should =~ %r{blob/cc1ba255d6c5ffdce87a357ba7ccc397a4f4026b}
  90 + end
  91 +
  92 + Given 'I click side-by-side diff button' do
  93 + click_link "Side-by-side Diff"
  94 + end
  95 +
  96 + Then 'I see side-by-side diff button' do
  97 + page.should have_content "Side-by-side Diff"
  98 + end
  99 +
  100 + Then 'I see inline diff button' do
  101 + page.should have_content "Inline Diff"
  102 + end
  103 +
  104 +end
features/steps/project/browse_commits_user_lookup.rb 0 → 100644
@@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
  1 +class ProjectBrowseCommitsUserLookup < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 +
  6 + Given 'I have the user that authored the commits' do
  7 + @user = create(:user, email: 'dmitriy.zaporozhets@gmail.com')
  8 + create(:email, { user: @user, email: 'dzaporozhets@sphereconsultinginc.com' })
  9 + end
  10 +
  11 + Given 'I click on commit link' do
  12 + visit project_commit_path(@project, ValidCommit::ID)
  13 + end
  14 +
  15 + Given 'I click on another commit link' do
  16 + visit project_commit_path(@project, ValidCommitWithAltEmail::ID)
  17 + end
  18 +
  19 + Then 'I see commit info' do
  20 + page.should have_content ValidCommit::MESSAGE
  21 + check_author_link(ValidCommit::AUTHOR_EMAIL)
  22 + end
  23 +
  24 + Then 'I see other commit info' do
  25 + page.should have_content ValidCommitWithAltEmail::MESSAGE
  26 + check_author_link(ValidCommitWithAltEmail::AUTHOR_EMAIL)
  27 + end
  28 +
  29 + def check_author_link(email)
  30 + author_link = find('.commit-author-link')
  31 + author_link['href'].should == user_path(@user)
  32 + author_link['data-original-title'].should == email
  33 + find('.commit-author-name').text.should == @user.name
  34 + end
  35 +end
features/steps/project/browse_files.rb 0 → 100644
@@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
  1 +class ProjectBrowseFiles < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 +
  6 + step '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 + step 'I should see files from repository for "8470d70"' do
  13 + current_path.should == project_tree_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 + step 'I click on "Gemfile.lock" file in repo' do
  20 + click_link "Gemfile.lock"
  21 + end
  22 +
  23 + step 'I should see it content' do
  24 + page.should have_content "DEPENDENCIES"
  25 + end
  26 +
  27 + step 'I click link "raw"' do
  28 + click_link "raw"
  29 + end
  30 +
  31 + step 'I should see raw file content' do
  32 + page.source.should == ValidCommit::BLOB_FILE
  33 + end
  34 +
  35 + step 'I click button "edit"' do
  36 + click_link 'edit'
  37 + end
  38 +
  39 + step 'I can edit code' do
  40 + page.execute_script('editor.setValue("GitlabFileEditor")')
  41 + page.evaluate_script('editor.getValue()').should == "GitlabFileEditor"
  42 + end
  43 +
  44 + step 'I click on "new file" link in repo' do
  45 + click_link 'new-file-link'
  46 + end
  47 +
  48 + step 'I can see new file page' do
  49 + page.should have_content "New file"
  50 + page.should have_content "File name"
  51 + page.should have_content "Commit message"
  52 + end
  53 +end
features/steps/project/browse_git_repo.rb 0 → 100644
@@ -0,0 +1,19 @@ @@ -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.lock" file in repo' do
  7 + click_link "Gemfile.lock"
  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 "DEPENDENCIES"
  16 + page.should have_content "Dmitriy Zaporozhets"
  17 + page.should have_content "Moving to rails 3.2"
  18 + end
  19 +end
features/steps/project/browse_tags.rb 0 → 100644
@@ -0,0 +1,10 @@ @@ -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
features/steps/project/create.rb 0 → 100644
@@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
  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: 'Empty'
  7 + click_button "Create project"
  8 + end
  9 +
  10 + Then 'I should see project page' do
  11 + current_path.should == project_path(Project.last)
  12 + page.should have_content "Empty"
  13 + end
  14 +
  15 + And 'I should see empty project instuctions' do
  16 + page.should have_content "git init"
  17 + page.should have_content "git remote"
  18 + page.should have_content Project.last.url_to_repo
  19 + end
  20 +
  21 + Then 'I see empty project instuctions' do
  22 + page.should have_content "git init"
  23 + page.should have_content "git remote"
  24 + page.should have_content Project.last.url_to_repo
  25 + end
  26 +
  27 + And 'I click on HTTP' do
  28 + click_button 'HTTP'
  29 + end
  30 +
  31 + Then 'Remote url should update to http link' do
  32 + page.should have_content "git remote add origin #{Project.last.http_url_to_repo}"
  33 + end
  34 +
  35 + And 'If I click on SSH' do
  36 + click_button 'SSH'
  37 + end
  38 +
  39 + Then 'Remote url should update to ssh link' do
  40 + page.should have_content "git remote add origin #{Project.last.url_to_repo}"
  41 + end
  42 +end
features/steps/project/create_project.rb
@@ -1,42 +0,0 @@ @@ -1,42 +0,0 @@
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: 'Empty'  
7 - click_button "Create project"  
8 - end  
9 -  
10 - Then 'I should see project page' do  
11 - current_path.should == project_path(Project.last)  
12 - page.should have_content "Empty"  
13 - end  
14 -  
15 - And 'I should see empty project instuctions' do  
16 - page.should have_content "git init"  
17 - page.should have_content "git remote"  
18 - page.should have_content Project.last.url_to_repo  
19 - end  
20 -  
21 - Then 'I see empty project instuctions' do  
22 - page.should have_content "git init"  
23 - page.should have_content "git remote"  
24 - page.should have_content Project.last.url_to_repo  
25 - end  
26 -  
27 - And 'I click on HTTP' do  
28 - click_button 'HTTP'  
29 - end  
30 -  
31 - Then 'Remote url should update to http link' do  
32 - page.should have_content "git remote add origin #{Project.last.http_url_to_repo}"  
33 - end  
34 -  
35 - And 'If I click on SSH' do  
36 - click_button 'SSH'  
37 - end  
38 -  
39 - Then 'Remote url should update to ssh link' do  
40 - page.should have_content "git remote add origin #{Project.last.url_to_repo}"  
41 - end  
42 -end  
features/steps/project/filter_labels.rb 0 → 100644
@@ -0,0 +1,70 @@ @@ -0,0 +1,70 @@
  1 +class ProjectFilterLabels < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 +
  6 + Then 'I should see "bug" in labels filter' do
  7 + within ".labels-filter" do
  8 + page.should have_content "bug"
  9 + end
  10 + end
  11 +
  12 + And 'I should see "feature" in labels filter' do
  13 + within ".labels-filter" do
  14 + page.should have_content "feature"
  15 + end
  16 + end
  17 +
  18 + And 'I should see "enhancement" in labels filter' do
  19 + within ".labels-filter" do
  20 + page.should have_content "enhancement"
  21 + end
  22 + end
  23 +
  24 + Then 'I should see "Bugfix1" in issues list' do
  25 + within ".issues-list" do
  26 + page.should have_content "Bugfix1"
  27 + end
  28 + end
  29 +
  30 + And 'I should see "Bugfix2" in issues list' do
  31 + within ".issues-list" do
  32 + page.should have_content "Bugfix2"
  33 + end
  34 + end
  35 +
  36 + And 'I should not see "Bugfix2" in issues list' do
  37 + within ".issues-list" do
  38 + page.should_not have_content "Bugfix2"
  39 + end
  40 + end
  41 +
  42 + And 'I should not see "Feature1" in issues list' do
  43 + within ".issues-list" do
  44 + page.should_not have_content "Feature1"
  45 + end
  46 + end
  47 +
  48 + Given 'I click link "bug"' do
  49 + click_link "bug"
  50 + end
  51 +
  52 + Given 'I click link "feature"' do
  53 + click_link "feature"
  54 + end
  55 +
  56 + And 'project "Shop" has issue "Bugfix1" with tags: "bug", "feature"' do
  57 + project = Project.find_by(name: "Shop")
  58 + create(:issue, title: "Bugfix1", project: project, label_list: ['bug', 'feature'])
  59 + end
  60 +
  61 + And 'project "Shop" has issue "Bugfix2" with tags: "bug", "enhancement"' do
  62 + project = Project.find_by(name: "Shop")
  63 + create(:issue, title: "Bugfix2", project: project, label_list: ['bug', 'enhancement'])
  64 + end
  65 +
  66 + And 'project "Shop" has issue "Feature1" with tags: "feature"' do
  67 + project = Project.find_by(name: "Shop")
  68 + create(:issue, title: "Feature1", project: project, label_list: 'feature')
  69 + end
  70 +end
features/steps/project/fork.rb 0 → 100644
@@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
  1 +class ForkProject < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedProject
  5 +
  6 + step 'I click link "Fork"' do
  7 + page.should have_content "Shop"
  8 + page.should have_content "Fork"
  9 + Gitlab::Shell.any_instance.stub(:fork_repository).and_return(true)
  10 + click_link "Fork"
  11 + end
  12 +
  13 + step 'I am a member of project "Shop"' do
  14 + @project = Project.find_by(name: "Shop")
  15 + @project ||= create(:project, name: "Shop", group: create(:group))
  16 + @project.team << [@user, :reporter]
  17 + end
  18 +
  19 + step 'I should see the forked project page' do
  20 + page.should have_content "Project was successfully forked."
  21 + current_path.should include current_user.namespace.path
  22 + @forked_project = Project.find_by(namespace_id: current_user.namespace.path)
  23 + end
  24 +
  25 + step 'I already have a project named "Shop" in my namespace' do
  26 + current_user.namespace ||= create(:namespace)
  27 + current_user.namespace.should_not be_nil
  28 + current_user.namespace.path.should_not be_nil
  29 + @my_project = create(:project, name: "Shop", namespace: current_user.namespace)
  30 + end
  31 +
  32 + step 'I should see a "Name has already been taken" warning' do
  33 + page.should have_content "Name has already been taken"
  34 + end
  35 +
  36 +end
features/steps/project/forked_merge_requests.rb 0 → 100644
@@ -0,0 +1,183 @@ @@ -0,0 +1,183 @@
  1 +class ProjectForkedMergeRequests < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedNote
  5 + include SharedPaths
  6 + include Select2Helper
  7 +
  8 + step 'I am a member of project "Shop"' do
  9 + @project = Project.find_by(name: "Shop")
  10 + @project ||= create(:project, name: "Shop")
  11 + @project.team << [@user, :reporter]
  12 + end
  13 +
  14 + step 'I have a project forked off of "Shop" called "Forked Shop"' do
  15 + @forking_user = @user
  16 + forked_project_link = build(:forked_project_link)
  17 + @forked_project = Project.find_by(name: "Forked Shop")
  18 + @forked_project ||= create(:project, name: "Forked Shop", forked_project_link: forked_project_link, creator_id: @forking_user.id , namespace: @forking_user.namespace)
  19 +
  20 + forked_project_link.forked_from_project = @project
  21 + forked_project_link.forked_to_project = @forked_project
  22 + @forked_project.team << [@forking_user , :master]
  23 + forked_project_link.save!
  24 + end
  25 +
  26 + step 'I click link "New Merge Request"' do
  27 + click_link "New Merge Request"
  28 + end
  29 +
  30 + step 'I should see merge request "Merge Request On Forked Project"' do
  31 + @project.merge_requests.size.should >= 1
  32 + @merge_request = @project.merge_requests.last
  33 + current_path.should == project_merge_request_path(@project, @merge_request)
  34 + @merge_request.title.should == "Merge Request On Forked Project"
  35 + @merge_request.source_project.should == @forked_project
  36 + @merge_request.source_branch.should == "master"
  37 + @merge_request.target_branch.should == "stable"
  38 + page.should have_content @forked_project.path_with_namespace
  39 + page.should have_content @project.path_with_namespace
  40 + page.should have_content @merge_request.source_branch
  41 + page.should have_content @merge_request.target_branch
  42 + end
  43 +
  44 + step 'I fill out a "Merge Request On Forked Project" merge request' do
  45 + select2 @forked_project.id, from: "#merge_request_source_project_id"
  46 + select2 @project.id, from: "#merge_request_target_project_id"
  47 +
  48 + find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s
  49 + find(:select, "merge_request_target_project_id", {}).value.should == @project.id.to_s
  50 +
  51 + select2 "master", from: "#merge_request_source_branch"
  52 + select2 "stable", from: "#merge_request_target_branch"
  53 +
  54 + find(:select, "merge_request_source_branch", {}).value.should == 'master'
  55 + find(:select, "merge_request_target_branch", {}).value.should == 'stable'
  56 +
  57 + fill_in "merge_request_title", with: "Merge Request On Forked Project"
  58 + end
  59 +
  60 + step 'I submit the merge request' do
  61 + click_button "Submit merge request"
  62 + end
  63 +
  64 + step 'I follow the target commit link' do
  65 + commit = @project.repository.commit
  66 + click_link commit.short_id(8)
  67 + end
  68 +
  69 + step 'I should see the commit under the forked from project' do
  70 + commit = @project.repository.commit
  71 + page.should have_content(commit.message)
  72 + end
  73 +
  74 + step 'I click "Create Merge Request on fork" link' do
  75 + click_link "Create Merge Request on fork"
  76 + end
  77 +
  78 + step 'I see prefilled new Merge Request page for the forked project' do
  79 + current_path.should == new_project_merge_request_path(@forked_project)
  80 + find("#merge_request_source_project_id").value.should == @forked_project.id.to_s
  81 + find("#merge_request_target_project_id").value.should == @project.id.to_s
  82 + find("#merge_request_source_branch").value.should have_content "new_design"
  83 + find("#merge_request_target_branch").value.should have_content "master"
  84 + find("#merge_request_title").value.should == "New Design"
  85 + verify_commit_link(".mr_target_commit",@project)
  86 + verify_commit_link(".mr_source_commit",@forked_project)
  87 + end
  88 +
  89 + step 'I update the merge request title' do
  90 + fill_in "merge_request_title", with: "An Edited Forked Merge Request"
  91 + end
  92 +
  93 + step 'I save the merge request' do
  94 + click_button "Save changes"
  95 + end
  96 +
  97 + step 'I should see the edited merge request' do
  98 + page.should have_content "An Edited Forked Merge Request"
  99 + @project.merge_requests.size.should >= 1
  100 + @merge_request = @project.merge_requests.last
  101 + current_path.should == project_merge_request_path(@project, @merge_request)
  102 + @merge_request.source_project.should == @forked_project
  103 + @merge_request.source_branch.should == "master"
  104 + @merge_request.target_branch.should == "stable"
  105 + page.should have_content @forked_project.path_with_namespace
  106 + page.should have_content @project.path_with_namespace
  107 + page.should have_content @merge_request.source_branch
  108 + page.should have_content @merge_request.target_branch
  109 + end
  110 +
  111 + step 'I should see last push widget' do
  112 + page.should have_content "You pushed to new_design"
  113 + page.should have_link "Create Merge Request"
  114 + end
  115 +
  116 + step 'project "Forked Shop" has push event' do
  117 + @forked_project = Project.find_by(name: "Forked Shop")
  118 +
  119 + data = {
  120 + before: "0000000000000000000000000000000000000000",
  121 + after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
  122 + ref: "refs/heads/new_design",
  123 + user_id: @user.id,
  124 + user_name: @user.name,
  125 + repository: {
  126 + name: @forked_project.name,
  127 + url: "localhost/rubinius",
  128 + description: "",
  129 + homepage: "localhost/rubinius",
  130 + private: true
  131 + }
  132 + }
  133 +
  134 + @event = Event.create(
  135 + project: @forked_project,
  136 + action: Event::PUSHED,
  137 + data: data,
  138 + author_id: @user.id
  139 + )
  140 + end
  141 +
  142 +
  143 + step 'I click link edit "Merge Request On Forked Project"' do
  144 + find("#edit_merge_request").click
  145 + end
  146 +
  147 + step 'I see the edit page prefilled for "Merge Request On Forked Project"' do
  148 + current_path.should == edit_project_merge_request_path(@project, @merge_request)
  149 + page.should have_content "Edit merge request ##{@merge_request.id}"
  150 + find("#merge_request_title").value.should == "Merge Request On Forked Project"
  151 + find("#merge_request_source_project_id").value.should == @forked_project.id.to_s
  152 + find("#merge_request_target_project_id").value.should == @project.id.to_s
  153 + find("#merge_request_source_branch").value.should have_content "master"
  154 + verify_commit_link(".mr_source_commit",@forked_project)
  155 + find("#merge_request_target_branch").value.should have_content "stable"
  156 + verify_commit_link(".mr_target_commit",@project)
  157 + end
  158 +
  159 + step 'I fill out an invalid "Merge Request On Forked Project" merge request' do
  160 + #If this isn't filled in the rest of the validations won't be triggered
  161 + fill_in "merge_request_title", with: "Merge Request On Forked Project"
  162 + find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s
  163 + find(:select, "merge_request_target_project_id", {}).value.should == @forked_project.id.to_s
  164 + find(:select, "merge_request_source_branch", {}).value.should == ""
  165 + find(:select, "merge_request_target_branch", {}).value.should == ""
  166 + end
  167 +
  168 + step 'I should see validation errors' do
  169 + page.should have_content "Source branch can't be blank"
  170 + page.should have_content "Target branch can't be blank"
  171 + page.should have_content "Branch conflict You can not use same project/branch for source and target"
  172 + end
  173 +
  174 + def project
  175 + @project ||= Project.find_by!(name: "Shop")
  176 + end
  177 +
  178 + # Verify a link is generated against the correct project
  179 + def verify_commit_link(container_div, container_project)
  180 + # This should force a wait for the javascript to execute
  181 + find(:div,container_div).find(".commit_short_id")['href'].should have_content "#{container_project.path_with_namespace}/commit"
  182 + end
  183 +end
features/steps/project/graph.rb 0 → 100644
@@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
  1 +class ProjectGraph < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 +
  5 + Then 'page should have graphs' do
  6 + page.should have_selector ".stat-graph"
  7 + end
  8 +
  9 + When 'I visit project "Shop" graph page' do
  10 + project = Project.find_by(name: "Shop")
  11 + visit project_graph_path(project, "master")
  12 + end
  13 +end
features/steps/project/hooks.rb 0 → 100644
@@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
  1 +require 'webmock'
  2 +
  3 +class ProjectHooks < Spinach::FeatureSteps
  4 + include SharedAuthentication
  5 + include SharedProject
  6 + include SharedPaths
  7 + include RSpec::Matchers
  8 + include RSpec::Mocks::ExampleMethods
  9 + include WebMock::API
  10 +
  11 + Given 'project has hook' do
  12 + @hook = create(:project_hook, project: current_project)
  13 + end
  14 +
  15 + Then 'I should see project hook' do
  16 + page.should have_content @hook.url
  17 + end
  18 +
  19 + When 'I submit new hook' do
  20 + @url = Faker::Internet.uri("http")
  21 + fill_in "hook_url", with: @url
  22 + expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1)
  23 + end
  24 +
  25 + Then 'I should see newly created hook' do
  26 + page.current_path.should == project_hooks_path(current_project)
  27 + page.should have_content(@url)
  28 + end
  29 +
  30 + When 'I click test hook button' do
  31 + stub_request(:post, @hook.url).to_return(status: 200)
  32 + click_link 'Test Hook'
  33 + end
  34 +
  35 + Then 'hook should be triggered' do
  36 + page.current_path.should == project_hooks_path(current_project)
  37 + end
  38 +end
features/steps/project/issue_tracker.rb 0 → 100644
@@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
  1 +class ProjectIssueTracker < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 +
  6 + step 'project "Shop" has issues enabled' do
  7 + @project = Project.find_by(name: "Shop")
  8 + @project ||= create(:project, name: "Shop", namespace: @user.namespace)
  9 + @project.issues_enabled = true
  10 + end
  11 +
  12 + step 'change the issue tracker to "GitLab"' do
  13 + select 'GitLab', from: 'project_issues_tracker'
  14 + end
  15 +
  16 + step 'I the project should have "GitLab" as issue tracker' do
  17 + find_field('project_issues_tracker').value.should == 'gitlab'
  18 + end
  19 +
  20 + step 'change the issue tracker to "Redmine"' do
  21 + select 'Redmine', from: 'project_issues_tracker'
  22 + end
  23 +
  24 + step 'I the project should have "Redmine" as issue tracker' do
  25 + find_field('project_issues_tracker').value.should == 'redmine'
  26 + end
  27 +
  28 + And 'I save project' do
  29 + click_button 'Save changes'
  30 + end
  31 +end
features/steps/project/issues.rb 0 → 100644
@@ -0,0 +1,145 @@ @@ -0,0 +1,145 @@
  1 +class ProjectIssues < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedNote
  5 + include SharedPaths
  6 + include SharedMarkdown
  7 +
  8 + Given 'I should see "Release 0.4" in issues' do
  9 + page.should have_content "Release 0.4"
  10 + end
  11 +
  12 + And 'I should not see "Release 0.3" in issues' do
  13 + page.should_not have_content "Release 0.3"
  14 + end
  15 +
  16 + And 'I should not see "Tweet control" in issues' do
  17 + page.should_not have_content "Tweet control"
  18 + end
  19 +
  20 + Given 'I click link "Closed"' do
  21 + click_link "Closed"
  22 + end
  23 +
  24 + Then 'I should see "Release 0.3" in issues' do
  25 + page.should have_content "Release 0.3"
  26 + end
  27 +
  28 + And 'I should not see "Release 0.4" in issues' do
  29 + page.should_not have_content "Release 0.4"
  30 + end
  31 +
  32 + Given 'I click link "All"' do
  33 + click_link "All"
  34 + end
  35 +
  36 + Given 'I click link "Release 0.4"' do
  37 + click_link "Release 0.4"
  38 + end
  39 +
  40 + Then 'I should see issue "Release 0.4"' do
  41 + page.should have_content "Release 0.4"
  42 + end
  43 +
  44 + Given 'I click link "New Issue"' do
  45 + click_link "New Issue"
  46 + end
  47 +
  48 + And 'I submit new issue "500 error on profile"' do
  49 + fill_in "issue_title", with: "500 error on profile"
  50 + click_button "Submit new issue"
  51 + end
  52 +
  53 + Given 'I click link "500 error on profile"' do
  54 + click_link "500 error on profile"
  55 + end
  56 +
  57 + Then 'I should see issue "500 error on profile"' do
  58 + issue = Issue.find_by(title: "500 error on profile")
  59 + page.should have_content issue.title
  60 + page.should have_content issue.author_name
  61 + page.should have_content issue.project.name
  62 + end
  63 +
  64 + Given 'I fill in issue search with "Re"' do
  65 + fill_in 'issue_search', with: "Re"
  66 + end
  67 +
  68 + Given 'I fill in issue search with "Bu"' do
  69 + fill_in 'issue_search', with: "Bu"
  70 + end
  71 +
  72 + And 'I fill in issue search with ".3"' do
  73 + fill_in 'issue_search', with: ".3"
  74 + end
  75 +
  76 + And 'I fill in issue search with "Something"' do
  77 + fill_in 'issue_search', with: "Something"
  78 + end
  79 +
  80 + And 'I fill in issue search with ""' do
  81 + fill_in 'issue_search', with: ""
  82 + end
  83 +
  84 + Given 'project "Shop" has milestone "v2.2"' do
  85 + project = Project.find_by(name: "Shop")
  86 + milestone = create(:milestone, title: "v2.2", project: project)
  87 +
  88 + 3.times { create(:issue, project: project, milestone: milestone) }
  89 + end
  90 +
  91 + And 'project "Shop" has milestone "v3.0"' do
  92 + project = Project.find_by(name: "Shop")
  93 + milestone = create(:milestone, title: "v3.0", project: project)
  94 +
  95 + 3.times { create(:issue, project: project, milestone: milestone) }
  96 + end
  97 +
  98 + When 'I select milestone "v3.0"' do
  99 + select "v3.0", from: "milestone_id"
  100 + end
  101 +
  102 + Then 'I should see selected milestone with title "v3.0"' do
  103 + issues_milestone_selector = "#issue_milestone_id_chzn > a"
  104 + page.find(issues_milestone_selector).should have_content("v3.0")
  105 + end
  106 +
  107 + When 'I select first assignee from "Shop" project' do
  108 + project = Project.find_by(name: "Shop")
  109 + first_assignee = project.users.first
  110 + select first_assignee.name, from: "assignee_id"
  111 + end
  112 +
  113 + Then 'I should see first assignee from "Shop" as selected assignee' do
  114 + issues_assignee_selector = "#issue_assignee_id_chzn > a"
  115 + project = Project.find_by(name: "Shop")
  116 + assignee_name = project.users.first.name
  117 + page.find(issues_assignee_selector).should have_content(assignee_name)
  118 + end
  119 +
  120 + And 'project "Shop" have "Release 0.4" open issue' do
  121 + project = Project.find_by(name: "Shop")
  122 + create(:issue,
  123 + title: "Release 0.4",
  124 + project: project,
  125 + author: project.users.first,
  126 + description: "# Description header"
  127 + )
  128 + end
  129 +
  130 + And 'project "Shop" have "Tweet control" open issue' do
  131 + project = Project.find_by(name: "Shop")
  132 + create(:issue,
  133 + title: "Tweet control",
  134 + project: project,
  135 + author: project.users.first)
  136 + end
  137 +
  138 + And 'project "Shop" have "Release 0.3" closed issue' do
  139 + project = Project.find_by(name: "Shop")
  140 + create(:closed_issue,
  141 + title: "Release 0.3",
  142 + project: project,
  143 + author: project.users.first)
  144 + end
  145 +end
features/steps/project/labels.rb 0 → 100644
@@ -0,0 +1,24 @@ @@ -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 + create(:issue, project: project, label_list: label)
  22 + end
  23 + end
  24 +end
features/steps/project/markdown_render.rb 0 → 100644
@@ -0,0 +1,207 @@ @@ -0,0 +1,207 @@
  1 +class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedMarkdown
  5 +
  6 + And 'I own project "Delta"' do
  7 + @project = Project.find_by(name: "Delta")
  8 + @project ||= create(:project, name: "Delta", namespace: @user.namespace)
  9 + @project.team << [@user, :master]
  10 + end
  11 +
  12 + Then 'I should see files from repository in master' do
  13 + current_path.should == project_tree_path(@project, "master")
  14 + page.should have_content "Gemfile"
  15 + page.should have_content "app"
  16 + page.should have_content "README"
  17 + end
  18 +
  19 + And 'I should see rendered README which contains correct links' do
  20 + page.should have_content "Welcome to GitLab GitLab is a free project and repository management application"
  21 + page.should have_link "GitLab API doc"
  22 + page.should have_link "GitLab API website"
  23 + page.should have_link "Rake tasks"
  24 + page.should have_link "backup and restore procedure"
  25 + page.should have_link "GitLab API doc directory"
  26 + page.should have_link "Maintenance"
  27 + end
  28 +
  29 + And 'I click on Gitlab API in README' do
  30 + click_link "GitLab API doc"
  31 + end
  32 +
  33 + Then 'I should see correct document rendered' do
  34 + current_path.should == project_blob_path(@project, "master/doc/api/README.md")
  35 + page.should have_content "All API requests require authentication"
  36 + end
  37 +
  38 + And 'I click on Rake tasks in README' do
  39 + click_link "Rake tasks"
  40 + end
  41 +
  42 + Then 'I should see correct directory rendered' do
  43 + current_path.should == project_tree_path(@project, "master/doc/raketasks")
  44 + page.should have_content "backup_restore.md"
  45 + page.should have_content "maintenance.md"
  46 + end
  47 +
  48 + And 'I click on GitLab API doc directory in README' do
  49 + click_link "GitLab API doc directory"
  50 + end
  51 +
  52 + Then 'I should see correct doc/api directory rendered' do
  53 + current_path.should == project_tree_path(@project, "master/doc/api/")
  54 + page.should have_content "README.md"
  55 + page.should have_content "users.md"
  56 + end
  57 +
  58 + And 'I click on Maintenance in README' do
  59 + click_link "Maintenance"
  60 + end
  61 +
  62 + Then 'I should see correct maintenance file rendered' do
  63 + current_path.should == project_blob_path(@project, "master/doc/raketasks/maintenance.md")
  64 + page.should have_content "bundle exec rake gitlab:env:info RAILS_ENV=production"
  65 + end
  66 +
  67 + And 'I navigate to the doc/api/README' do
  68 + click_link "doc"
  69 + click_link "api"
  70 + click_link "README.md"
  71 + end
  72 +
  73 + And 'I see correct file rendered' do
  74 + current_path.should == project_blob_path(@project, "master/doc/api/README.md")
  75 + page.should have_content "Contents"
  76 + page.should have_link "Users"
  77 + page.should have_link "Rake tasks"
  78 + end
  79 +
  80 + And 'I click on users in doc/api/README' do
  81 + click_link "Users"
  82 + end
  83 +
  84 + Then 'I should see the correct document file' do
  85 + current_path.should == project_blob_path(@project, "master/doc/api/users.md")
  86 + page.should have_content "Get a list of users."
  87 + end
  88 +
  89 + And 'I click on raketasks in doc/api/README' do
  90 + click_link "Rake tasks"
  91 + end
  92 +
  93 + When 'I visit markdown branch' do
  94 + visit project_tree_path(@project, "markdown")
  95 + end
  96 +
  97 + Then 'I should see files from repository in markdown branch' do
  98 + current_path.should == project_tree_path(@project, "markdown")
  99 + page.should have_content "Gemfile"
  100 + page.should have_content "app"
  101 + page.should have_content "README"
  102 + end
  103 +
  104 + And 'I see correct file rendered in markdown branch' do
  105 + current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")
  106 + page.should have_content "Contents"
  107 + page.should have_link "Users"
  108 + page.should have_link "Rake tasks"
  109 + end
  110 +
  111 + Then 'I should see correct document rendered for markdown branch' do
  112 + current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")
  113 + page.should have_content "All API requests require authentication"
  114 + end
  115 +
  116 + Then 'I should see correct directory rendered for markdown branch' do
  117 + current_path.should == project_tree_path(@project, "markdown/doc/raketasks")
  118 + page.should have_content "backup_restore.md"
  119 + page.should have_content "maintenance.md"
  120 + end
  121 +
  122 + Then 'I should see the users document file in markdown branch' do
  123 + current_path.should == project_blob_path(@project, "markdown/doc/api/users.md")
  124 + page.should have_content "Get a list of users."
  125 + end
  126 +
  127 + Given 'I go to wiki page' do
  128 + click_link "Wiki"
  129 + current_path.should == project_wiki_path(@project, "home")
  130 + end
  131 +
  132 + And 'I add various links to the wiki page' do
  133 + fill_in "wiki[content]", with: "[test](test)\n[GitLab API doc](doc/api/README.md)\n[Rake tasks](doc/raketasks)\n"
  134 + fill_in "wiki[message]", with: "Adding links to wiki"
  135 + click_button "Create page"
  136 + end
  137 +
  138 + Then 'Wiki page should have added links' do
  139 + current_path.should == project_wiki_path(@project, "home")
  140 + page.should have_content "test GitLab API doc Rake tasks"
  141 + end
  142 +
  143 + step 'I add a header to the wiki page' do
  144 + fill_in "wiki[content]", with: "# Wiki header\n"
  145 + fill_in "wiki[message]", with: "Add header to wiki"
  146 + click_button "Create page"
  147 + end
  148 +
  149 + step 'Wiki header should have correct id and link' do
  150 + header_should_have_correct_id_and_link(1, 'Wiki header', 'wiki-header')
  151 + end
  152 +
  153 + And 'I click on test link' do
  154 + click_link "test"
  155 + end
  156 +
  157 + Then 'I see new wiki page named test' do
  158 + current_path.should == project_wiki_path(@project, "test")
  159 + page.should have_content "Editing"
  160 + end
  161 +
  162 + When 'I go back to wiki page home' do
  163 + visit project_wiki_path(@project, "home")
  164 + current_path.should == project_wiki_path(@project, "home")
  165 + end
  166 +
  167 + And 'I click on GitLab API doc link' do
  168 + click_link "GitLab API"
  169 + end
  170 +
  171 + Then 'I see Gitlab API document' do
  172 + current_path.should == project_blob_path(@project, "master/doc/api/README.md")
  173 + page.should have_content "Status codes"
  174 + end
  175 +
  176 + And 'I click on Rake tasks link' do
  177 + click_link "Rake tasks"
  178 + end
  179 +
  180 + Then 'I see Rake tasks directory' do
  181 + current_path.should == project_tree_path(@project, "master/doc/raketasks")
  182 + page.should have_content "backup_restore.md"
  183 + page.should have_content "maintenance.md"
  184 + end
  185 +
  186 + Given 'I go directory which contains README file' do
  187 + visit project_tree_path(@project, "master/doc/api")
  188 + current_path.should == project_tree_path(@project, "master/doc/api")
  189 + end
  190 +
  191 + And 'I click on a relative link in README' do
  192 + click_link "Users"
  193 + end
  194 +
  195 + Then 'I should see the correct markdown' do
  196 + current_path.should == project_blob_path(@project, "master/doc/api/users.md")
  197 + page.should have_content "List users"
  198 + end
  199 +
  200 + step 'Header "Application details" should have correct id and link' do
  201 + header_should_have_correct_id_and_link(2, 'Application details', 'application-details')
  202 + end
  203 +
  204 + step 'Header "GitLab API" should have correct id and link' do
  205 + header_should_have_correct_id_and_link(1, 'GitLab API', 'gitlab-api')
  206 + end
  207 +end
features/steps/project/merge_requests.rb 0 → 100644
@@ -0,0 +1,195 @@ @@ -0,0 +1,195 @@
  1 +class ProjectMergeRequests < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedNote
  5 + include SharedPaths
  6 + include SharedMarkdown
  7 +
  8 + step 'I click link "New Merge Request"' do
  9 + click_link "New Merge Request"
  10 + end
  11 +
  12 + step 'I click link "Bug NS-04"' do
  13 + click_link "Bug NS-04"
  14 + end
  15 +
  16 + step 'I click link "All"' do
  17 + click_link "All"
  18 + end
  19 +
  20 + step 'I click link "Closed"' do
  21 + click_link "Closed"
  22 + end
  23 +
  24 + step 'I should see merge request "Wiki Feature"' do
  25 + within '.merge-request' do
  26 + page.should have_content "Wiki Feature"
  27 + end
  28 + end
  29 +
  30 + step 'I should see closed merge request "Bug NS-04"' do
  31 + merge_request = MergeRequest.find_by!(title: "Bug NS-04")
  32 + merge_request.closed?.should be_true
  33 + page.should have_content "Closed by"
  34 + end
  35 +
  36 + step 'I should see merge request "Bug NS-04"' do
  37 + page.should have_content "Bug NS-04"
  38 + end
  39 +
  40 + step 'I should see "Bug NS-04" in merge requests' do
  41 + page.should have_content "Bug NS-04"
  42 + end
  43 +
  44 + step 'I should see "Feature NS-03" in merge requests' do
  45 + page.should have_content "Feature NS-03"
  46 + end
  47 +
  48 + step 'I should not see "Feature NS-03" in merge requests' do
  49 + page.should_not have_content "Feature NS-03"
  50 + end
  51 +
  52 +
  53 + step 'I should not see "Bug NS-04" in merge requests' do
  54 + page.should_not have_content "Bug NS-04"
  55 + end
  56 +
  57 + step 'I click link "Close"' do
  58 + within '.page-title' do
  59 + click_link "Close"
  60 + end
  61 + end
  62 +
  63 + step 'I submit new merge request "Wiki Feature"' do
  64 + fill_in "merge_request_title", with: "Wiki Feature"
  65 + select "master", from: "merge_request_source_branch"
  66 + select "notes_refactoring", from: "merge_request_target_branch"
  67 + click_button "Submit merge request"
  68 + end
  69 +
  70 + step 'project "Shop" have "Bug NS-04" open merge request' do
  71 + create(:merge_request,
  72 + title: "Bug NS-04",
  73 + source_project: project,
  74 + target_project: project,
  75 + source_branch: 'stable',
  76 + target_branch: 'master',
  77 + author: project.users.first,
  78 + description: "# Description header"
  79 + )
  80 + end
  81 +
  82 + step 'project "Shop" have "Bug NS-05" open merge request with diffs inside' do
  83 + create(:merge_request_with_diffs,
  84 + title: "Bug NS-05",
  85 + source_project: project,
  86 + target_project: project,
  87 + author: project.users.first)
  88 + end
  89 +
  90 + step 'project "Shop" have "Feature NS-03" closed merge request' do
  91 + create(:closed_merge_request,
  92 + title: "Feature NS-03",
  93 + source_project: project,
  94 + target_project: project,
  95 + author: project.users.first)
  96 + end
  97 +
  98 + step 'I switch to the diff tab' do
  99 + visit diffs_project_merge_request_path(project, merge_request)
  100 + end
  101 +
  102 + step 'I switch to the merge request\'s comments tab' do
  103 + visit project_merge_request_path(project, merge_request)
  104 + end
  105 +
  106 + step 'I click on the first commit in the merge request' do
  107 + within '.first-commits' do
  108 + click_link merge_request.commits.first.short_id(8)
  109 + end
  110 + end
  111 +
  112 + step 'I leave a comment on the diff page' do
  113 + init_diff_note
  114 + leave_comment "One comment to rule them all"
  115 + end
  116 +
  117 + step 'I leave a comment on the diff page in commit' do
  118 + find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click
  119 + leave_comment "One comment to rule them all"
  120 + end
  121 +
  122 + step 'I leave a comment like "Line is wrong" on line 185 of the first file' do
  123 + init_diff_note
  124 + leave_comment "Line is wrong"
  125 + end
  126 +
  127 + step 'I leave a comment like "Line is wrong" on line 185 of the first file in commit' do
  128 + find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click
  129 + leave_comment "Line is wrong"
  130 + end
  131 +
  132 + step 'I should see a discussion has started on line 185' do
  133 + page.should have_content "#{current_user.name} started a discussion on this merge request diff"
  134 + page.should have_content "app/assets/stylesheets/tree.scss:L185"
  135 + page.should have_content "Line is wrong"
  136 + end
  137 +
  138 + step 'I should see a discussion has started on commit b1e6a9dbf1:L185' do
  139 + page.should have_content "#{current_user.name} started a discussion on commit"
  140 + page.should have_content "app/assets/stylesheets/tree.scss:L185"
  141 + page.should have_content "Line is wrong"
  142 + end
  143 +
  144 + step 'I should see a discussion has started on commit b1e6a9dbf1' do
  145 + page.should have_content "#{current_user.name} started a discussion on commit"
  146 + page.should have_content "One comment to rule them all"
  147 + page.should have_content "app/assets/stylesheets/tree.scss:L185"
  148 + end
  149 +
  150 + step 'merge request is mergeable' do
  151 + page.should have_content 'You can accept this request automatically'
  152 + end
  153 +
  154 + step 'I modify merge commit message' do
  155 + find('.modify-merge-commit-link').click
  156 + fill_in 'merge_commit_message', with: "wow such merge"
  157 + end
  158 +
  159 + step 'merge request "Bug NS-05" is mergeable' do
  160 + merge_request.mark_as_mergeable
  161 + end
  162 +
  163 + step 'I accept this merge request' do
  164 + click_button "Accept Merge Request"
  165 + end
  166 +
  167 + step 'I should see merged request' do
  168 + within '.issue-box' do
  169 + page.should have_content "Merged"
  170 + end
  171 + end
  172 +
  173 + def project
  174 + @project ||= Project.find_by!(name: "Shop")
  175 + end
  176 +
  177 + def merge_request
  178 + @merge_request ||= MergeRequest.find_by!(title: "Bug NS-05")
  179 + end
  180 +
  181 + def init_diff_note
  182 + find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185"]').click
  183 + end
  184 +
  185 + def leave_comment(message)
  186 + within(".js-discussion-note-form") do
  187 + fill_in "note_note", with: message
  188 + click_button "Add Comment"
  189 + end
  190 +
  191 + within ".note-text" do
  192 + page.should have_content message
  193 + end
  194 + end
  195 +end
features/steps/project/milestones.rb 0 → 100644
@@ -0,0 +1,59 @@ @@ -0,0 +1,59 @@
  1 +class ProjectMilestones < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 + include SharedMarkdown
  6 +
  7 + Then 'I should see milestone "v2.2"' do
  8 + milestone = @project.milestones.find_by(title: "v2.2")
  9 + page.should have_content(milestone.title[0..10])
  10 + page.should have_content(milestone.expires_at)
  11 + page.should have_content("Browse Issues")
  12 + end
  13 +
  14 + Given 'I click link "v2.2"' do
  15 + click_link "v2.2"
  16 + end
  17 +
  18 + Given 'I click link "New Milestone"' do
  19 + click_link "New Milestone"
  20 + end
  21 +
  22 + And 'I submit new milestone "v2.3"' do
  23 + fill_in "milestone_title", with: "v2.3"
  24 + click_button "Create milestone"
  25 + end
  26 +
  27 + Then 'I should see milestone "v2.3"' do
  28 + milestone = @project.milestones.find_by(title: "v2.3")
  29 + page.should have_content(milestone.title[0..10])
  30 + page.should have_content(milestone.expires_at)
  31 + page.should have_content("Browse Issues")
  32 + end
  33 +
  34 + And 'project "Shop" has milestone "v2.2"' do
  35 + project = Project.find_by(name: "Shop")
  36 + milestone = create(:milestone,
  37 + title: "v2.2",
  38 + project: project,
  39 + description: "# Description header"
  40 + )
  41 + 3.times { create(:issue, project: project, milestone: milestone) }
  42 + end
  43 +
  44 + Given 'the milestone has open and closed issues' do
  45 + project = Project.find_by(name: "Shop")
  46 + milestone = project.milestones.find_by(title: 'v2.2')
  47 +
  48 + # 3 Open issues created above; create one closed issue
  49 + create(:closed_issue, project: project, milestone: milestone)
  50 + end
  51 +
  52 + When 'I click link "All Issues"' do
  53 + click_link 'All Issues'
  54 + end
  55 +
  56 + Then "I should see 3 issues" do
  57 + page.should have_selector('#tab-issues li', count: 4)
  58 + end
  59 +end
features/steps/project/multiselect_blob.rb 0 → 100644
@@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
  1 +class ProjectMultiselectBlob < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 +
  6 + class << self
  7 + def click_line_steps(*line_numbers)
  8 + line_numbers.each do |line_number|
  9 + step "I click line #{line_number} in file" do
  10 + find("#L#{line_number}").click
  11 + end
  12 +
  13 + step "I shift-click line #{line_number} in file" do
  14 + script = "$('#L#{line_number}').trigger($.Event('click', { shiftKey: true }));"
  15 + page.evaluate_script(script)
  16 + end
  17 + end
  18 + end
  19 +
  20 + def check_state_steps(*ranges)
  21 + ranges.each do |range|
  22 + fragment = range.kind_of?(Array) ? "L#{range.first}-#{range.last}" : "L#{range}"
  23 + pluralization = range.kind_of?(Array) ? "s" : ""
  24 +
  25 + step "I should see \"#{fragment}\" as URI fragment" do
  26 + URI.parse(current_url).fragment.should == fragment
  27 + end
  28 +
  29 + step "I should see line#{pluralization} #{fragment[1..-1]} highlighted" do
  30 + ids = Array(range).map { |n| "LC#{n}" }
  31 + extra = false
  32 +
  33 + highlighted = all("#tree-content-holder .highlight .line.hll")
  34 + highlighted.each do |element|
  35 + extra ||= ids.delete(element[:id]).nil?
  36 + end
  37 +
  38 + extra.should be_false and ids.should be_empty
  39 + end
  40 + end
  41 + end
  42 + end
  43 +
  44 + click_line_steps *Array(1..5)
  45 + check_state_steps *Array(1..5), Array(1..2), Array(1..3), Array(1..4), Array(1..5), Array(3..5)
  46 +
  47 + step 'I go back in history' do
  48 + page.evaluate_script("window.history.back()")
  49 + end
  50 +
  51 + step 'I go forward in history' do
  52 + page.evaluate_script("window.history.forward()")
  53 + end
  54 +
  55 + step 'I click on "Gemfile.lock" file in repo' do
  56 + click_link "Gemfile.lock"
  57 + end
  58 +end
0 \ No newline at end of file 59 \ No newline at end of file
features/steps/project/network_graph.rb 0 → 100644
@@ -0,0 +1,93 @@ @@ -0,0 +1,93 @@
  1 +class ProjectNetworkGraph < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedProject
  5 +
  6 + Then 'page should have network graph' do
  7 + page.should have_selector ".network-graph"
  8 + end
  9 +
  10 + When 'I visit project "Shop" network page' do
  11 + # Stub Graph max_size to speed up test (10 commits vs. 650)
  12 + Network::Graph.stub(max_count: 10)
  13 +
  14 + project = Project.find_by(name: "Shop")
  15 + visit project_network_path(project, "master")
  16 + end
  17 +
  18 + And 'page should select "master" in select box' do
  19 + page.should have_selector '.select2-chosen', text: "master"
  20 + end
  21 +
  22 + And 'page should select "v2.1.0" in select box' do
  23 + page.should have_selector '.select2-chosen', text: "v2.1.0"
  24 + end
  25 +
  26 + And 'page should have "master" on graph' do
  27 + within '.network-graph' do
  28 + page.should have_content 'master'
  29 + end
  30 + end
  31 +
  32 + When 'I switch ref to "stable"' do
  33 + page.select 'stable', from: 'ref'
  34 + sleep 2
  35 + end
  36 +
  37 + When 'I switch ref to "v2.1.0"' do
  38 + page.select 'v2.1.0', from: 'ref'
  39 + sleep 2
  40 + end
  41 +
  42 + When 'click "Show only selected branch" checkbox' do
  43 + find('#filter_ref').click
  44 + sleep 2
  45 + end
  46 +
  47 + Then 'page should have content not containing "v2.1.0"' do
  48 + within '.network-graph' do
  49 + page.should have_content 'cleaning'
  50 + end
  51 + end
  52 +
  53 + Then 'page should not have content not containing "v2.1.0"' do
  54 + within '.network-graph' do
  55 + page.should_not have_content 'cleaning'
  56 + end
  57 + end
  58 +
  59 + And 'page should select "stable" in select box' do
  60 + page.should have_selector '.select2-chosen', text: "stable"
  61 + end
  62 +
  63 + And 'page should select "v2.1.0" in select box' do
  64 + page.should have_selector '.select2-chosen', text: "v2.1.0"
  65 + end
  66 +
  67 + And 'page should have "stable" on graph' do
  68 + within '.network-graph' do
  69 + page.should have_content 'stable'
  70 + end
  71 + end
  72 +
  73 + When 'I looking for a commit by SHA of "v2.1.0"' do
  74 + within ".network-form" do
  75 + fill_in 'extended_sha1', with: '98d6492'
  76 + find('button').click
  77 + end
  78 + sleep 2
  79 + end
  80 +
  81 + And 'page should have "v2.1.0" on graph' do
  82 + within '.network-graph' do
  83 + page.should have_content 'v2.1.0'
  84 + end
  85 + end
  86 +
  87 + When 'I look for a commit by ";"' do
  88 + within ".network-form" do
  89 + fill_in 'extended_sha1', with: ';'
  90 + find('button').click
  91 + end
  92 + end
  93 +end
features/steps/project/project_active_tab.rb
@@ -1,140 +0,0 @@ @@ -1,140 +0,0 @@
1 -class ProjectActiveTab < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedProject  
5 - include SharedActiveTab  
6 -  
7 - # Main Tabs  
8 -  
9 - Then 'the active main tab should be Home' do  
10 - ensure_active_main_tab('Home')  
11 - end  
12 -  
13 - Then 'the active main tab should be Settings' do  
14 - ensure_active_main_tab('Settings')  
15 - end  
16 -  
17 - Then 'the active main tab should be Files' do  
18 - ensure_active_main_tab('Files')  
19 - end  
20 -  
21 - Then 'the active main tab should be Commits' do  
22 - ensure_active_main_tab('Commits')  
23 - end  
24 -  
25 - Then 'the active main tab should be Network' do  
26 - ensure_active_main_tab('Network')  
27 - end  
28 -  
29 - Then 'the active main tab should be Issues' do  
30 - ensure_active_main_tab('Issues')  
31 - end  
32 -  
33 - Then 'the active main tab should be Merge Requests' do  
34 - ensure_active_main_tab('Merge Requests')  
35 - end  
36 -  
37 - Then 'the active main tab should be Wall' do  
38 - ensure_active_main_tab('Wall')  
39 - end  
40 -  
41 - Then 'the active main tab should be Wiki' do  
42 - ensure_active_main_tab('Wiki')  
43 - end  
44 -  
45 - # Sub Tabs: Home  
46 -  
47 - Given 'I click the "Team" tab' do  
48 - click_link('Members')  
49 - end  
50 -  
51 - Given 'I click the "Attachments" tab' do  
52 - click_link('Attachments')  
53 - end  
54 -  
55 - Given 'I click the "Snippets" tab' do  
56 - click_link('Snippets')  
57 - end  
58 -  
59 - Given 'I click the "Edit" tab' do  
60 - within '.project-settings-nav' do  
61 - click_link('Project')  
62 - end  
63 - end  
64 -  
65 - Given 'I click the "Hooks" tab' do  
66 - click_link('Web Hooks')  
67 - end  
68 -  
69 - Given 'I click the "Deploy Keys" tab' do  
70 - click_link('Deploy Keys')  
71 - end  
72 -  
73 - Then 'the active sub nav should be Team' do  
74 - ensure_active_sub_nav('Members')  
75 - end  
76 -  
77 - Then 'the active sub nav should be Edit' do  
78 - ensure_active_sub_nav('Project')  
79 - end  
80 -  
81 - Then 'the active sub nav should be Hooks' do  
82 - ensure_active_sub_nav('Web Hooks')  
83 - end  
84 -  
85 - Then 'the active sub nav should be Deploy Keys' do  
86 - ensure_active_sub_nav('Deploy Keys')  
87 - end  
88 -  
89 - # Sub Tabs: Commits  
90 -  
91 - Given 'I click the "Compare" tab' do  
92 - click_link('Compare')  
93 - end  
94 -  
95 - Given 'I click the "Branches" tab' do  
96 - click_link('Branches')  
97 - end  
98 -  
99 - Given 'I click the "Tags" tab' do  
100 - click_link('Tags')  
101 - end  
102 -  
103 - Then 'the active sub tab should be Commits' do  
104 - ensure_active_sub_tab('Commits')  
105 - end  
106 -  
107 - Then 'the active sub tab should be Compare' do  
108 - ensure_active_sub_tab('Compare')  
109 - end  
110 -  
111 - Then 'the active sub tab should be Branches' do  
112 - ensure_active_sub_tab('Branches')  
113 - end  
114 -  
115 - Then 'the active sub tab should be Tags' do  
116 - ensure_active_sub_tab('Tags')  
117 - end  
118 -  
119 - # Sub Tabs: Issues  
120 -  
121 - Given 'I click the "Milestones" tab' do  
122 - click_link('Milestones')  
123 - end  
124 -  
125 - Given 'I click the "Labels" tab' do  
126 - click_link('Labels')  
127 - end  
128 -  
129 - Then 'the active sub tab should be Browse Issues' do  
130 - ensure_active_sub_tab('Browse Issues')  
131 - end  
132 -  
133 - Then 'the active sub tab should be Milestones' do  
134 - ensure_active_sub_tab('Milestones')  
135 - end  
136 -  
137 - Then 'the active sub tab should be Labels' do  
138 - ensure_active_sub_tab('Labels')  
139 - end  
140 -end  
features/steps/project/project_archived.rb
@@ -1,37 +0,0 @@ @@ -1,37 +0,0 @@
1 -class ProjectArchived < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 -  
6 - When 'project "Forum" is archived' do  
7 - project = Project.find_by(name: "Forum")  
8 - project.update_attribute(:archived, true)  
9 - end  
10 -  
11 - When 'project "Shop" is archived' do  
12 - project = Project.find_by(name: "Shop")  
13 - project.update_attribute(:archived, true)  
14 - end  
15 -  
16 - When 'I visit project "Forum" page' do  
17 - project = Project.find_by(name: "Forum")  
18 - visit project_path(project)  
19 - end  
20 -  
21 - Then 'I should not see "Archived"' do  
22 - page.should_not have_content "Archived"  
23 - end  
24 -  
25 - Then 'I should see "Archived"' do  
26 - page.should have_content "Archived"  
27 - end  
28 -  
29 - When 'I set project archived' do  
30 - click_link "Archive"  
31 - end  
32 -  
33 - When 'I set project unarchived' do  
34 - click_link "Unarchive"  
35 - end  
36 -  
37 -end  
38 \ No newline at end of file 0 \ No newline at end of file
features/steps/project/project_browse_branches.rb
@@ -1,35 +0,0 @@ @@ -1,35 +0,0 @@
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 ".protected-branches-list" 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  
features/steps/project/project_browse_commits.rb
@@ -1,104 +0,0 @@ @@ -1,104 +0,0 @@
1 -class ProjectBrowseCommits < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 -  
6 - Then 'I see project commits' do  
7 - commit = @project.repository.commit  
8 - page.should have_content(@project.name)  
9 - page.should have_content(commit.message)  
10 - page.should have_content(commit.id.to_s[0..5])  
11 - end  
12 -  
13 - Given 'I click atom feed link' do  
14 - click_link "Feed"  
15 - end  
16 -  
17 - Then 'I see commits atom feed' do  
18 - commit = @project.repository.commit  
19 - page.response_headers['Content-Type'].should have_content("application/atom+xml")  
20 - page.body.should have_selector("title", text: "Recent commits to #{@project.name}")  
21 - page.body.should have_selector("author email", text: commit.author_email)  
22 - page.body.should have_selector("entry summary", text: commit.description)  
23 - end  
24 -  
25 - Given 'I click on commit link' do  
26 - visit project_commit_path(@project, ValidCommit::ID)  
27 - end  
28 -  
29 - Then 'I see commit info' do  
30 - page.should have_content ValidCommit::MESSAGE  
31 - page.should have_content "Showing 1 changed file"  
32 - end  
33 -  
34 - And 'I fill compare fields with refs' do  
35 - fill_in "from", with: "8716fc78f3c65bbf7bcf7b574febd583bc5d2812"  
36 - fill_in "to", with: "bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a"  
37 - click_button "Compare"  
38 - end  
39 -  
40 - Then 'I see compared refs' do  
41 - page.should have_content "Compare View"  
42 - page.should have_content "Commits (1)"  
43 - page.should have_content "Showing 2 changed files"  
44 - end  
45 -  
46 - Then 'I see breadcrumb links' do  
47 - page.should have_selector('ul.breadcrumb')  
48 - page.should have_selector('ul.breadcrumb span.divider', count: 3)  
49 - page.should have_selector('ul.breadcrumb a', count: 4)  
50 -  
51 - find('ul.breadcrumb li:nth-child(2) a')['href'].should match(/#{@project.path_with_namespace}\/commits\/master\z/)  
52 - find('ul.breadcrumb li:last a')['href'].should match(%r{master/app/models/project\.rb\z})  
53 - end  
54 -  
55 - Then 'I see commits stats' do  
56 - page.should have_content 'Top 50 Committers'  
57 - page.should have_content 'Committers'  
58 - page.should have_content 'Total commits'  
59 - page.should have_content 'Authors'  
60 - end  
61 -  
62 - Given 'I visit big commit page' do  
63 - visit project_commit_path(@project, BigCommits::BIG_COMMIT_ID)  
64 - end  
65 -  
66 - Then 'I see big commit warning' do  
67 - page.should have_content BigCommits::BIG_COMMIT_MESSAGE  
68 - page.should have_content "Warning! This is a large diff"  
69 - page.should have_content "If you still want to see the diff"  
70 - end  
71 -  
72 - Given 'I visit huge commit page' do  
73 - visit project_commit_path(@project, BigCommits::HUGE_COMMIT_ID)  
74 - end  
75 -  
76 - Then 'I see huge commit message' do  
77 - page.should have_content BigCommits::HUGE_COMMIT_MESSAGE  
78 - page.should have_content "Warning! This is a large diff"  
79 - page.should_not have_content "If you still want to see the diff"  
80 - end  
81 -  
82 - Given 'I visit a commit with an image that changed' do  
83 - visit project_commit_path(@project, 'cc1ba255d6c5ffdce87a357ba7ccc397a4f4026b')  
84 - end  
85 -  
86 - Then 'The diff links to both the previous and current image' do  
87 - links = page.all('.two-up span div a')  
88 - links[0]['href'].should =~ %r{blob/bc3735004cb45cec5e0e4fa92710897a910a5957}  
89 - links[1]['href'].should =~ %r{blob/cc1ba255d6c5ffdce87a357ba7ccc397a4f4026b}  
90 - end  
91 -  
92 - Given 'I click side-by-side diff button' do  
93 - click_link "Side-by-side Diff"  
94 - end  
95 -  
96 - Then 'I see side-by-side diff button' do  
97 - page.should have_content "Side-by-side Diff"  
98 - end  
99 -  
100 - Then 'I see inline diff button' do  
101 - page.should have_content "Inline Diff"  
102 - end  
103 -  
104 -end  
features/steps/project/project_browse_commits_user_lookup.rb
@@ -1,35 +0,0 @@ @@ -1,35 +0,0 @@
1 -class ProjectBrowseCommitsUserLookup < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 -  
6 - Given 'I have the user that authored the commits' do  
7 - @user = create(:user, email: 'dmitriy.zaporozhets@gmail.com')  
8 - create(:email, { user: @user, email: 'dzaporozhets@sphereconsultinginc.com' })  
9 - end  
10 -  
11 - Given 'I click on commit link' do  
12 - visit project_commit_path(@project, ValidCommit::ID)  
13 - end  
14 -  
15 - Given 'I click on another commit link' do  
16 - visit project_commit_path(@project, ValidCommitWithAltEmail::ID)  
17 - end  
18 -  
19 - Then 'I see commit info' do  
20 - page.should have_content ValidCommit::MESSAGE  
21 - check_author_link(ValidCommit::AUTHOR_EMAIL)  
22 - end  
23 -  
24 - Then 'I see other commit info' do  
25 - page.should have_content ValidCommitWithAltEmail::MESSAGE  
26 - check_author_link(ValidCommitWithAltEmail::AUTHOR_EMAIL)  
27 - end  
28 -  
29 - def check_author_link(email)  
30 - author_link = find('.commit-author-link')  
31 - author_link['href'].should == user_path(@user)  
32 - author_link['data-original-title'].should == email  
33 - find('.commit-author-name').text.should == @user.name  
34 - end  
35 -end  
features/steps/project/project_browse_files.rb
@@ -1,53 +0,0 @@ @@ -1,53 +0,0 @@
1 -class ProjectBrowseFiles < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 -  
6 - step '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 - step 'I should see files from repository for "8470d70"' do  
13 - current_path.should == project_tree_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 - step 'I click on "Gemfile.lock" file in repo' do  
20 - click_link "Gemfile.lock"  
21 - end  
22 -  
23 - step 'I should see it content' do  
24 - page.should have_content "DEPENDENCIES"  
25 - end  
26 -  
27 - step 'I click link "raw"' do  
28 - click_link "raw"  
29 - end  
30 -  
31 - step 'I should see raw file content' do  
32 - page.source.should == ValidCommit::BLOB_FILE  
33 - end  
34 -  
35 - step 'I click button "edit"' do  
36 - click_link 'edit'  
37 - end  
38 -  
39 - step 'I can edit code' do  
40 - page.execute_script('editor.setValue("GitlabFileEditor")')  
41 - page.evaluate_script('editor.getValue()').should == "GitlabFileEditor"  
42 - end  
43 -  
44 - step 'I click on "new file" link in repo' do  
45 - click_link 'new-file-link'  
46 - end  
47 -  
48 - step 'I can see new file page' do  
49 - page.should have_content "New file"  
50 - page.should have_content "File name"  
51 - page.should have_content "Commit message"  
52 - end  
53 -end  
features/steps/project/project_browse_git_repo.rb
@@ -1,19 +0,0 @@ @@ -1,19 +0,0 @@
1 -class ProjectBrowseGitRepo < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 -  
6 - Given 'I click on "Gemfile.lock" file in repo' do  
7 - click_link "Gemfile.lock"  
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 "DEPENDENCIES"  
16 - page.should have_content "Dmitriy Zaporozhets"  
17 - page.should have_content "Moving to rails 3.2"  
18 - end  
19 -end  
features/steps/project/project_browse_tags.rb
@@ -1,10 +0,0 @@ @@ -1,10 +0,0 @@
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  
features/steps/project/project_filter_labels.rb
@@ -1,70 +0,0 @@ @@ -1,70 +0,0 @@
1 -class ProjectFilterLabels < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 -  
6 - Then 'I should see "bug" in labels filter' do  
7 - within ".labels-filter" do  
8 - page.should have_content "bug"  
9 - end  
10 - end  
11 -  
12 - And 'I should see "feature" in labels filter' do  
13 - within ".labels-filter" do  
14 - page.should have_content "feature"  
15 - end  
16 - end  
17 -  
18 - And 'I should see "enhancement" in labels filter' do  
19 - within ".labels-filter" do  
20 - page.should have_content "enhancement"  
21 - end  
22 - end  
23 -  
24 - Then 'I should see "Bugfix1" in issues list' do  
25 - within ".issues-list" do  
26 - page.should have_content "Bugfix1"  
27 - end  
28 - end  
29 -  
30 - And 'I should see "Bugfix2" in issues list' do  
31 - within ".issues-list" do  
32 - page.should have_content "Bugfix2"  
33 - end  
34 - end  
35 -  
36 - And 'I should not see "Bugfix2" in issues list' do  
37 - within ".issues-list" do  
38 - page.should_not have_content "Bugfix2"  
39 - end  
40 - end  
41 -  
42 - And 'I should not see "Feature1" in issues list' do  
43 - within ".issues-list" do  
44 - page.should_not have_content "Feature1"  
45 - end  
46 - end  
47 -  
48 - Given 'I click link "bug"' do  
49 - click_link "bug"  
50 - end  
51 -  
52 - Given 'I click link "feature"' do  
53 - click_link "feature"  
54 - end  
55 -  
56 - And 'project "Shop" has issue "Bugfix1" with tags: "bug", "feature"' do  
57 - project = Project.find_by(name: "Shop")  
58 - create(:issue, title: "Bugfix1", project: project, label_list: ['bug', 'feature'])  
59 - end  
60 -  
61 - And 'project "Shop" has issue "Bugfix2" with tags: "bug", "enhancement"' do  
62 - project = Project.find_by(name: "Shop")  
63 - create(:issue, title: "Bugfix2", project: project, label_list: ['bug', 'enhancement'])  
64 - end  
65 -  
66 - And 'project "Shop" has issue "Feature1" with tags: "feature"' do  
67 - project = Project.find_by(name: "Shop")  
68 - create(:issue, title: "Feature1", project: project, label_list: 'feature')  
69 - end  
70 -end  
features/steps/project/project_fork.rb
@@ -1,36 +0,0 @@ @@ -1,36 +0,0 @@
1 -class ForkProject < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedProject  
5 -  
6 - step 'I click link "Fork"' do  
7 - page.should have_content "Shop"  
8 - page.should have_content "Fork"  
9 - Gitlab::Shell.any_instance.stub(:fork_repository).and_return(true)  
10 - click_link "Fork"  
11 - end  
12 -  
13 - step 'I am a member of project "Shop"' do  
14 - @project = Project.find_by(name: "Shop")  
15 - @project ||= create(:project, name: "Shop", group: create(:group))  
16 - @project.team << [@user, :reporter]  
17 - end  
18 -  
19 - step 'I should see the forked project page' do  
20 - page.should have_content "Project was successfully forked."  
21 - current_path.should include current_user.namespace.path  
22 - @forked_project = Project.find_by(namespace_id: current_user.namespace.path)  
23 - end  
24 -  
25 - step 'I already have a project named "Shop" in my namespace' do  
26 - current_user.namespace ||= create(:namespace)  
27 - current_user.namespace.should_not be_nil  
28 - current_user.namespace.path.should_not be_nil  
29 - @my_project = create(:project, name: "Shop", namespace: current_user.namespace)  
30 - end  
31 -  
32 - step 'I should see a "Name has already been taken" warning' do  
33 - page.should have_content "Name has already been taken"  
34 - end  
35 -  
36 -end  
features/steps/project/project_forked_merge_requests.rb
@@ -1,183 +0,0 @@ @@ -1,183 +0,0 @@
1 -class ProjectForkedMergeRequests < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedNote  
5 - include SharedPaths  
6 - include Select2Helper  
7 -  
8 - step 'I am a member of project "Shop"' do  
9 - @project = Project.find_by(name: "Shop")  
10 - @project ||= create(:project, name: "Shop")  
11 - @project.team << [@user, :reporter]  
12 - end  
13 -  
14 - step 'I have a project forked off of "Shop" called "Forked Shop"' do  
15 - @forking_user = @user  
16 - forked_project_link = build(:forked_project_link)  
17 - @forked_project = Project.find_by(name: "Forked Shop")  
18 - @forked_project ||= create(:project, name: "Forked Shop", forked_project_link: forked_project_link, creator_id: @forking_user.id , namespace: @forking_user.namespace)  
19 -  
20 - forked_project_link.forked_from_project = @project  
21 - forked_project_link.forked_to_project = @forked_project  
22 - @forked_project.team << [@forking_user , :master]  
23 - forked_project_link.save!  
24 - end  
25 -  
26 - step 'I click link "New Merge Request"' do  
27 - click_link "New Merge Request"  
28 - end  
29 -  
30 - step 'I should see merge request "Merge Request On Forked Project"' do  
31 - @project.merge_requests.size.should >= 1  
32 - @merge_request = @project.merge_requests.last  
33 - current_path.should == project_merge_request_path(@project, @merge_request)  
34 - @merge_request.title.should == "Merge Request On Forked Project"  
35 - @merge_request.source_project.should == @forked_project  
36 - @merge_request.source_branch.should == "master"  
37 - @merge_request.target_branch.should == "stable"  
38 - page.should have_content @forked_project.path_with_namespace  
39 - page.should have_content @project.path_with_namespace  
40 - page.should have_content @merge_request.source_branch  
41 - page.should have_content @merge_request.target_branch  
42 - end  
43 -  
44 - step 'I fill out a "Merge Request On Forked Project" merge request' do  
45 - select2 @forked_project.id, from: "#merge_request_source_project_id"  
46 - select2 @project.id, from: "#merge_request_target_project_id"  
47 -  
48 - find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s  
49 - find(:select, "merge_request_target_project_id", {}).value.should == @project.id.to_s  
50 -  
51 - select2 "master", from: "#merge_request_source_branch"  
52 - select2 "stable", from: "#merge_request_target_branch"  
53 -  
54 - find(:select, "merge_request_source_branch", {}).value.should == 'master'  
55 - find(:select, "merge_request_target_branch", {}).value.should == 'stable'  
56 -  
57 - fill_in "merge_request_title", with: "Merge Request On Forked Project"  
58 - end  
59 -  
60 - step 'I submit the merge request' do  
61 - click_button "Submit merge request"  
62 - end  
63 -  
64 - step 'I follow the target commit link' do  
65 - commit = @project.repository.commit  
66 - click_link commit.short_id(8)  
67 - end  
68 -  
69 - step 'I should see the commit under the forked from project' do  
70 - commit = @project.repository.commit  
71 - page.should have_content(commit.message)  
72 - end  
73 -  
74 - step 'I click "Create Merge Request on fork" link' do  
75 - click_link "Create Merge Request on fork"  
76 - end  
77 -  
78 - step 'I see prefilled new Merge Request page for the forked project' do  
79 - current_path.should == new_project_merge_request_path(@forked_project)  
80 - find("#merge_request_source_project_id").value.should == @forked_project.id.to_s  
81 - find("#merge_request_target_project_id").value.should == @project.id.to_s  
82 - find("#merge_request_source_branch").value.should have_content "new_design"  
83 - find("#merge_request_target_branch").value.should have_content "master"  
84 - find("#merge_request_title").value.should == "New Design"  
85 - verify_commit_link(".mr_target_commit",@project)  
86 - verify_commit_link(".mr_source_commit",@forked_project)  
87 - end  
88 -  
89 - step 'I update the merge request title' do  
90 - fill_in "merge_request_title", with: "An Edited Forked Merge Request"  
91 - end  
92 -  
93 - step 'I save the merge request' do  
94 - click_button "Save changes"  
95 - end  
96 -  
97 - step 'I should see the edited merge request' do  
98 - page.should have_content "An Edited Forked Merge Request"  
99 - @project.merge_requests.size.should >= 1  
100 - @merge_request = @project.merge_requests.last  
101 - current_path.should == project_merge_request_path(@project, @merge_request)  
102 - @merge_request.source_project.should == @forked_project  
103 - @merge_request.source_branch.should == "master"  
104 - @merge_request.target_branch.should == "stable"  
105 - page.should have_content @forked_project.path_with_namespace  
106 - page.should have_content @project.path_with_namespace  
107 - page.should have_content @merge_request.source_branch  
108 - page.should have_content @merge_request.target_branch  
109 - end  
110 -  
111 - step 'I should see last push widget' do  
112 - page.should have_content "You pushed to new_design"  
113 - page.should have_link "Create Merge Request"  
114 - end  
115 -  
116 - step 'project "Forked Shop" has push event' do  
117 - @forked_project = Project.find_by(name: "Forked Shop")  
118 -  
119 - data = {  
120 - before: "0000000000000000000000000000000000000000",  
121 - after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",  
122 - ref: "refs/heads/new_design",  
123 - user_id: @user.id,  
124 - user_name: @user.name,  
125 - repository: {  
126 - name: @forked_project.name,  
127 - url: "localhost/rubinius",  
128 - description: "",  
129 - homepage: "localhost/rubinius",  
130 - private: true  
131 - }  
132 - }  
133 -  
134 - @event = Event.create(  
135 - project: @forked_project,  
136 - action: Event::PUSHED,  
137 - data: data,  
138 - author_id: @user.id  
139 - )  
140 - end  
141 -  
142 -  
143 - step 'I click link edit "Merge Request On Forked Project"' do  
144 - find("#edit_merge_request").click  
145 - end  
146 -  
147 - step 'I see the edit page prefilled for "Merge Request On Forked Project"' do  
148 - current_path.should == edit_project_merge_request_path(@project, @merge_request)  
149 - page.should have_content "Edit merge request ##{@merge_request.id}"  
150 - find("#merge_request_title").value.should == "Merge Request On Forked Project"  
151 - find("#merge_request_source_project_id").value.should == @forked_project.id.to_s  
152 - find("#merge_request_target_project_id").value.should == @project.id.to_s  
153 - find("#merge_request_source_branch").value.should have_content "master"  
154 - verify_commit_link(".mr_source_commit",@forked_project)  
155 - find("#merge_request_target_branch").value.should have_content "stable"  
156 - verify_commit_link(".mr_target_commit",@project)  
157 - end  
158 -  
159 - step 'I fill out an invalid "Merge Request On Forked Project" merge request' do  
160 - #If this isn't filled in the rest of the validations won't be triggered  
161 - fill_in "merge_request_title", with: "Merge Request On Forked Project"  
162 - find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s  
163 - find(:select, "merge_request_target_project_id", {}).value.should == @forked_project.id.to_s  
164 - find(:select, "merge_request_source_branch", {}).value.should == ""  
165 - find(:select, "merge_request_target_branch", {}).value.should == ""  
166 - end  
167 -  
168 - step 'I should see validation errors' do  
169 - page.should have_content "Source branch can't be blank"  
170 - page.should have_content "Target branch can't be blank"  
171 - page.should have_content "Branch conflict You can not use same project/branch for source and target"  
172 - end  
173 -  
174 - def project  
175 - @project ||= Project.find_by!(name: "Shop")  
176 - end  
177 -  
178 - # Verify a link is generated against the correct project  
179 - def verify_commit_link(container_div, container_project)  
180 - # This should force a wait for the javascript to execute  
181 - find(:div,container_div).find(".commit_short_id")['href'].should have_content "#{container_project.path_with_namespace}/commit"  
182 - end  
183 -end  
features/steps/project/project_graph.rb
@@ -1,13 +0,0 @@ @@ -1,13 +0,0 @@
1 -class ProjectGraph < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 -  
5 - Then 'page should have graphs' do  
6 - page.should have_selector ".stat-graph"  
7 - end  
8 -  
9 - When 'I visit project "Shop" graph page' do  
10 - project = Project.find_by(name: "Shop")  
11 - visit project_graph_path(project, "master")  
12 - end  
13 -end  
features/steps/project/project_hooks.rb
@@ -1,38 +0,0 @@ @@ -1,38 +0,0 @@
1 -require 'webmock'  
2 -  
3 -class ProjectHooks < Spinach::FeatureSteps  
4 - include SharedAuthentication  
5 - include SharedProject  
6 - include SharedPaths  
7 - include RSpec::Matchers  
8 - include RSpec::Mocks::ExampleMethods  
9 - include WebMock::API  
10 -  
11 - Given 'project has hook' do  
12 - @hook = create(:project_hook, project: current_project)  
13 - end  
14 -  
15 - Then 'I should see project hook' do  
16 - page.should have_content @hook.url  
17 - end  
18 -  
19 - When 'I submit new hook' do  
20 - @url = Faker::Internet.uri("http")  
21 - fill_in "hook_url", with: @url  
22 - expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1)  
23 - end  
24 -  
25 - Then 'I should see newly created hook' do  
26 - page.current_path.should == project_hooks_path(current_project)  
27 - page.should have_content(@url)  
28 - end  
29 -  
30 - When 'I click test hook button' do  
31 - stub_request(:post, @hook.url).to_return(status: 200)  
32 - click_link 'Test Hook'  
33 - end  
34 -  
35 - Then 'hook should be triggered' do  
36 - page.current_path.should == project_hooks_path(current_project)  
37 - end  
38 -end  
features/steps/project/project_issue_tracker.rb
@@ -1,31 +0,0 @@ @@ -1,31 +0,0 @@
1 -class ProjectIssueTracker < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 -  
6 - step 'project "Shop" has issues enabled' do  
7 - @project = Project.find_by(name: "Shop")  
8 - @project ||= create(:project, name: "Shop", namespace: @user.namespace)  
9 - @project.issues_enabled = true  
10 - end  
11 -  
12 - step 'change the issue tracker to "GitLab"' do  
13 - select 'GitLab', from: 'project_issues_tracker'  
14 - end  
15 -  
16 - step 'I the project should have "GitLab" as issue tracker' do  
17 - find_field('project_issues_tracker').value.should == 'gitlab'  
18 - end  
19 -  
20 - step 'change the issue tracker to "Redmine"' do  
21 - select 'Redmine', from: 'project_issues_tracker'  
22 - end  
23 -  
24 - step 'I the project should have "Redmine" as issue tracker' do  
25 - find_field('project_issues_tracker').value.should == 'redmine'  
26 - end  
27 -  
28 - And 'I save project' do  
29 - click_button 'Save changes'  
30 - end  
31 -end  
features/steps/project/project_issues.rb
@@ -1,145 +0,0 @@ @@ -1,145 +0,0 @@
1 -class ProjectIssues < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedNote  
5 - include SharedPaths  
6 - include SharedMarkdown  
7 -  
8 - Given 'I should see "Release 0.4" in issues' do  
9 - page.should have_content "Release 0.4"  
10 - end  
11 -  
12 - And 'I should not see "Release 0.3" in issues' do  
13 - page.should_not have_content "Release 0.3"  
14 - end  
15 -  
16 - And 'I should not see "Tweet control" in issues' do  
17 - page.should_not have_content "Tweet control"  
18 - end  
19 -  
20 - Given 'I click link "Closed"' do  
21 - click_link "Closed"  
22 - end  
23 -  
24 - Then 'I should see "Release 0.3" in issues' do  
25 - page.should have_content "Release 0.3"  
26 - end  
27 -  
28 - And 'I should not see "Release 0.4" in issues' do  
29 - page.should_not have_content "Release 0.4"  
30 - end  
31 -  
32 - Given 'I click link "All"' do  
33 - click_link "All"  
34 - end  
35 -  
36 - Given 'I click link "Release 0.4"' do  
37 - click_link "Release 0.4"  
38 - end  
39 -  
40 - Then 'I should see issue "Release 0.4"' do  
41 - page.should have_content "Release 0.4"  
42 - end  
43 -  
44 - Given 'I click link "New Issue"' do  
45 - click_link "New Issue"  
46 - end  
47 -  
48 - And 'I submit new issue "500 error on profile"' do  
49 - fill_in "issue_title", with: "500 error on profile"  
50 - click_button "Submit new issue"  
51 - end  
52 -  
53 - Given 'I click link "500 error on profile"' do  
54 - click_link "500 error on profile"  
55 - end  
56 -  
57 - Then 'I should see issue "500 error on profile"' do  
58 - issue = Issue.find_by(title: "500 error on profile")  
59 - page.should have_content issue.title  
60 - page.should have_content issue.author_name  
61 - page.should have_content issue.project.name  
62 - end  
63 -  
64 - Given 'I fill in issue search with "Re"' do  
65 - fill_in 'issue_search', with: "Re"  
66 - end  
67 -  
68 - Given 'I fill in issue search with "Bu"' do  
69 - fill_in 'issue_search', with: "Bu"  
70 - end  
71 -  
72 - And 'I fill in issue search with ".3"' do  
73 - fill_in 'issue_search', with: ".3"  
74 - end  
75 -  
76 - And 'I fill in issue search with "Something"' do  
77 - fill_in 'issue_search', with: "Something"  
78 - end  
79 -  
80 - And 'I fill in issue search with ""' do  
81 - fill_in 'issue_search', with: ""  
82 - end  
83 -  
84 - Given 'project "Shop" has milestone "v2.2"' do  
85 - project = Project.find_by(name: "Shop")  
86 - milestone = create(:milestone, title: "v2.2", project: project)  
87 -  
88 - 3.times { create(:issue, project: project, milestone: milestone) }  
89 - end  
90 -  
91 - And 'project "Shop" has milestone "v3.0"' do  
92 - project = Project.find_by(name: "Shop")  
93 - milestone = create(:milestone, title: "v3.0", project: project)  
94 -  
95 - 3.times { create(:issue, project: project, milestone: milestone) }  
96 - end  
97 -  
98 - When 'I select milestone "v3.0"' do  
99 - select "v3.0", from: "milestone_id"  
100 - end  
101 -  
102 - Then 'I should see selected milestone with title "v3.0"' do  
103 - issues_milestone_selector = "#issue_milestone_id_chzn > a"  
104 - page.find(issues_milestone_selector).should have_content("v3.0")  
105 - end  
106 -  
107 - When 'I select first assignee from "Shop" project' do  
108 - project = Project.find_by(name: "Shop")  
109 - first_assignee = project.users.first  
110 - select first_assignee.name, from: "assignee_id"  
111 - end  
112 -  
113 - Then 'I should see first assignee from "Shop" as selected assignee' do  
114 - issues_assignee_selector = "#issue_assignee_id_chzn > a"  
115 - project = Project.find_by(name: "Shop")  
116 - assignee_name = project.users.first.name  
117 - page.find(issues_assignee_selector).should have_content(assignee_name)  
118 - end  
119 -  
120 - And 'project "Shop" have "Release 0.4" open issue' do  
121 - project = Project.find_by(name: "Shop")  
122 - create(:issue,  
123 - title: "Release 0.4",  
124 - project: project,  
125 - author: project.users.first,  
126 - description: "# Description header"  
127 - )  
128 - end  
129 -  
130 - And 'project "Shop" have "Tweet control" open issue' do  
131 - project = Project.find_by(name: "Shop")  
132 - create(:issue,  
133 - title: "Tweet control",  
134 - project: project,  
135 - author: project.users.first)  
136 - end  
137 -  
138 - And 'project "Shop" have "Release 0.3" closed issue' do  
139 - project = Project.find_by(name: "Shop")  
140 - create(:closed_issue,  
141 - title: "Release 0.3",  
142 - project: project,  
143 - author: project.users.first)  
144 - end  
145 -end  
features/steps/project/project_labels.rb
@@ -1,24 +0,0 @@ @@ -1,24 +0,0 @@
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 - create(:issue, project: project, label_list: label)  
22 - end  
23 - end  
24 -end  
features/steps/project/project_markdown_render.rb
@@ -1,207 +0,0 @@ @@ -1,207 +0,0 @@
1 -class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedMarkdown  
5 -  
6 - And 'I own project "Delta"' do  
7 - @project = Project.find_by(name: "Delta")  
8 - @project ||= create(:project, name: "Delta", namespace: @user.namespace)  
9 - @project.team << [@user, :master]  
10 - end  
11 -  
12 - Then 'I should see files from repository in master' do  
13 - current_path.should == project_tree_path(@project, "master")  
14 - page.should have_content "Gemfile"  
15 - page.should have_content "app"  
16 - page.should have_content "README"  
17 - end  
18 -  
19 - And 'I should see rendered README which contains correct links' do  
20 - page.should have_content "Welcome to GitLab GitLab is a free project and repository management application"  
21 - page.should have_link "GitLab API doc"  
22 - page.should have_link "GitLab API website"  
23 - page.should have_link "Rake tasks"  
24 - page.should have_link "backup and restore procedure"  
25 - page.should have_link "GitLab API doc directory"  
26 - page.should have_link "Maintenance"  
27 - end  
28 -  
29 - And 'I click on Gitlab API in README' do  
30 - click_link "GitLab API doc"  
31 - end  
32 -  
33 - Then 'I should see correct document rendered' do  
34 - current_path.should == project_blob_path(@project, "master/doc/api/README.md")  
35 - page.should have_content "All API requests require authentication"  
36 - end  
37 -  
38 - And 'I click on Rake tasks in README' do  
39 - click_link "Rake tasks"  
40 - end  
41 -  
42 - Then 'I should see correct directory rendered' do  
43 - current_path.should == project_tree_path(@project, "master/doc/raketasks")  
44 - page.should have_content "backup_restore.md"  
45 - page.should have_content "maintenance.md"  
46 - end  
47 -  
48 - And 'I click on GitLab API doc directory in README' do  
49 - click_link "GitLab API doc directory"  
50 - end  
51 -  
52 - Then 'I should see correct doc/api directory rendered' do  
53 - current_path.should == project_tree_path(@project, "master/doc/api/")  
54 - page.should have_content "README.md"  
55 - page.should have_content "users.md"  
56 - end  
57 -  
58 - And 'I click on Maintenance in README' do  
59 - click_link "Maintenance"  
60 - end  
61 -  
62 - Then 'I should see correct maintenance file rendered' do  
63 - current_path.should == project_blob_path(@project, "master/doc/raketasks/maintenance.md")  
64 - page.should have_content "bundle exec rake gitlab:env:info RAILS_ENV=production"  
65 - end  
66 -  
67 - And 'I navigate to the doc/api/README' do  
68 - click_link "doc"  
69 - click_link "api"  
70 - click_link "README.md"  
71 - end  
72 -  
73 - And 'I see correct file rendered' do  
74 - current_path.should == project_blob_path(@project, "master/doc/api/README.md")  
75 - page.should have_content "Contents"  
76 - page.should have_link "Users"  
77 - page.should have_link "Rake tasks"  
78 - end  
79 -  
80 - And 'I click on users in doc/api/README' do  
81 - click_link "Users"  
82 - end  
83 -  
84 - Then 'I should see the correct document file' do  
85 - current_path.should == project_blob_path(@project, "master/doc/api/users.md")  
86 - page.should have_content "Get a list of users."  
87 - end  
88 -  
89 - And 'I click on raketasks in doc/api/README' do  
90 - click_link "Rake tasks"  
91 - end  
92 -  
93 - When 'I visit markdown branch' do  
94 - visit project_tree_path(@project, "markdown")  
95 - end  
96 -  
97 - Then 'I should see files from repository in markdown branch' do  
98 - current_path.should == project_tree_path(@project, "markdown")  
99 - page.should have_content "Gemfile"  
100 - page.should have_content "app"  
101 - page.should have_content "README"  
102 - end  
103 -  
104 - And 'I see correct file rendered in markdown branch' do  
105 - current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")  
106 - page.should have_content "Contents"  
107 - page.should have_link "Users"  
108 - page.should have_link "Rake tasks"  
109 - end  
110 -  
111 - Then 'I should see correct document rendered for markdown branch' do  
112 - current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")  
113 - page.should have_content "All API requests require authentication"  
114 - end  
115 -  
116 - Then 'I should see correct directory rendered for markdown branch' do  
117 - current_path.should == project_tree_path(@project, "markdown/doc/raketasks")  
118 - page.should have_content "backup_restore.md"  
119 - page.should have_content "maintenance.md"  
120 - end  
121 -  
122 - Then 'I should see the users document file in markdown branch' do  
123 - current_path.should == project_blob_path(@project, "markdown/doc/api/users.md")  
124 - page.should have_content "Get a list of users."  
125 - end  
126 -  
127 - Given 'I go to wiki page' do  
128 - click_link "Wiki"  
129 - current_path.should == project_wiki_path(@project, "home")  
130 - end  
131 -  
132 - And 'I add various links to the wiki page' do  
133 - fill_in "wiki[content]", with: "[test](test)\n[GitLab API doc](doc/api/README.md)\n[Rake tasks](doc/raketasks)\n"  
134 - fill_in "wiki[message]", with: "Adding links to wiki"  
135 - click_button "Create page"  
136 - end  
137 -  
138 - Then 'Wiki page should have added links' do  
139 - current_path.should == project_wiki_path(@project, "home")  
140 - page.should have_content "test GitLab API doc Rake tasks"  
141 - end  
142 -  
143 - step 'I add a header to the wiki page' do  
144 - fill_in "wiki[content]", with: "# Wiki header\n"  
145 - fill_in "wiki[message]", with: "Add header to wiki"  
146 - click_button "Create page"  
147 - end  
148 -  
149 - step 'Wiki header should have correct id and link' do  
150 - header_should_have_correct_id_and_link(1, 'Wiki header', 'wiki-header')  
151 - end  
152 -  
153 - And 'I click on test link' do  
154 - click_link "test"  
155 - end  
156 -  
157 - Then 'I see new wiki page named test' do  
158 - current_path.should == project_wiki_path(@project, "test")  
159 - page.should have_content "Editing"  
160 - end  
161 -  
162 - When 'I go back to wiki page home' do  
163 - visit project_wiki_path(@project, "home")  
164 - current_path.should == project_wiki_path(@project, "home")  
165 - end  
166 -  
167 - And 'I click on GitLab API doc link' do  
168 - click_link "GitLab API"  
169 - end  
170 -  
171 - Then 'I see Gitlab API document' do  
172 - current_path.should == project_blob_path(@project, "master/doc/api/README.md")  
173 - page.should have_content "Status codes"  
174 - end  
175 -  
176 - And 'I click on Rake tasks link' do  
177 - click_link "Rake tasks"  
178 - end  
179 -  
180 - Then 'I see Rake tasks directory' do  
181 - current_path.should == project_tree_path(@project, "master/doc/raketasks")  
182 - page.should have_content "backup_restore.md"  
183 - page.should have_content "maintenance.md"  
184 - end  
185 -  
186 - Given 'I go directory which contains README file' do  
187 - visit project_tree_path(@project, "master/doc/api")  
188 - current_path.should == project_tree_path(@project, "master/doc/api")  
189 - end  
190 -  
191 - And 'I click on a relative link in README' do  
192 - click_link "Users"  
193 - end  
194 -  
195 - Then 'I should see the correct markdown' do  
196 - current_path.should == project_blob_path(@project, "master/doc/api/users.md")  
197 - page.should have_content "List users"  
198 - end  
199 -  
200 - step 'Header "Application details" should have correct id and link' do  
201 - header_should_have_correct_id_and_link(2, 'Application details', 'application-details')  
202 - end  
203 -  
204 - step 'Header "GitLab API" should have correct id and link' do  
205 - header_should_have_correct_id_and_link(1, 'GitLab API', 'gitlab-api')  
206 - end  
207 -end  
features/steps/project/project_merge_requests.rb
@@ -1,195 +0,0 @@ @@ -1,195 +0,0 @@
1 -class ProjectMergeRequests < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedNote  
5 - include SharedPaths  
6 - include SharedMarkdown  
7 -  
8 - step 'I click link "New Merge Request"' do  
9 - click_link "New Merge Request"  
10 - end  
11 -  
12 - step 'I click link "Bug NS-04"' do  
13 - click_link "Bug NS-04"  
14 - end  
15 -  
16 - step 'I click link "All"' do  
17 - click_link "All"  
18 - end  
19 -  
20 - step 'I click link "Closed"' do  
21 - click_link "Closed"  
22 - end  
23 -  
24 - step 'I should see merge request "Wiki Feature"' do  
25 - within '.merge-request' do  
26 - page.should have_content "Wiki Feature"  
27 - end  
28 - end  
29 -  
30 - step 'I should see closed merge request "Bug NS-04"' do  
31 - merge_request = MergeRequest.find_by!(title: "Bug NS-04")  
32 - merge_request.closed?.should be_true  
33 - page.should have_content "Closed by"  
34 - end  
35 -  
36 - step 'I should see merge request "Bug NS-04"' do  
37 - page.should have_content "Bug NS-04"  
38 - end  
39 -  
40 - step 'I should see "Bug NS-04" in merge requests' do  
41 - page.should have_content "Bug NS-04"  
42 - end  
43 -  
44 - step 'I should see "Feature NS-03" in merge requests' do  
45 - page.should have_content "Feature NS-03"  
46 - end  
47 -  
48 - step 'I should not see "Feature NS-03" in merge requests' do  
49 - page.should_not have_content "Feature NS-03"  
50 - end  
51 -  
52 -  
53 - step 'I should not see "Bug NS-04" in merge requests' do  
54 - page.should_not have_content "Bug NS-04"  
55 - end  
56 -  
57 - step 'I click link "Close"' do  
58 - within '.page-title' do  
59 - click_link "Close"  
60 - end  
61 - end  
62 -  
63 - step 'I submit new merge request "Wiki Feature"' do  
64 - fill_in "merge_request_title", with: "Wiki Feature"  
65 - select "master", from: "merge_request_source_branch"  
66 - select "notes_refactoring", from: "merge_request_target_branch"  
67 - click_button "Submit merge request"  
68 - end  
69 -  
70 - step 'project "Shop" have "Bug NS-04" open merge request' do  
71 - create(:merge_request,  
72 - title: "Bug NS-04",  
73 - source_project: project,  
74 - target_project: project,  
75 - source_branch: 'stable',  
76 - target_branch: 'master',  
77 - author: project.users.first,  
78 - description: "# Description header"  
79 - )  
80 - end  
81 -  
82 - step 'project "Shop" have "Bug NS-05" open merge request with diffs inside' do  
83 - create(:merge_request_with_diffs,  
84 - title: "Bug NS-05",  
85 - source_project: project,  
86 - target_project: project,  
87 - author: project.users.first)  
88 - end  
89 -  
90 - step 'project "Shop" have "Feature NS-03" closed merge request' do  
91 - create(:closed_merge_request,  
92 - title: "Feature NS-03",  
93 - source_project: project,  
94 - target_project: project,  
95 - author: project.users.first)  
96 - end  
97 -  
98 - step 'I switch to the diff tab' do  
99 - visit diffs_project_merge_request_path(project, merge_request)  
100 - end  
101 -  
102 - step 'I switch to the merge request\'s comments tab' do  
103 - visit project_merge_request_path(project, merge_request)  
104 - end  
105 -  
106 - step 'I click on the first commit in the merge request' do  
107 - within '.first-commits' do  
108 - click_link merge_request.commits.first.short_id(8)  
109 - end  
110 - end  
111 -  
112 - step 'I leave a comment on the diff page' do  
113 - init_diff_note  
114 - leave_comment "One comment to rule them all"  
115 - end  
116 -  
117 - step 'I leave a comment on the diff page in commit' do  
118 - find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click  
119 - leave_comment "One comment to rule them all"  
120 - end  
121 -  
122 - step 'I leave a comment like "Line is wrong" on line 185 of the first file' do  
123 - init_diff_note  
124 - leave_comment "Line is wrong"  
125 - end  
126 -  
127 - step 'I leave a comment like "Line is wrong" on line 185 of the first file in commit' do  
128 - find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click  
129 - leave_comment "Line is wrong"  
130 - end  
131 -  
132 - step 'I should see a discussion has started on line 185' do  
133 - page.should have_content "#{current_user.name} started a discussion on this merge request diff"  
134 - page.should have_content "app/assets/stylesheets/tree.scss:L185"  
135 - page.should have_content "Line is wrong"  
136 - end  
137 -  
138 - step 'I should see a discussion has started on commit b1e6a9dbf1:L185' do  
139 - page.should have_content "#{current_user.name} started a discussion on commit"  
140 - page.should have_content "app/assets/stylesheets/tree.scss:L185"  
141 - page.should have_content "Line is wrong"  
142 - end  
143 -  
144 - step 'I should see a discussion has started on commit b1e6a9dbf1' do  
145 - page.should have_content "#{current_user.name} started a discussion on commit"  
146 - page.should have_content "One comment to rule them all"  
147 - page.should have_content "app/assets/stylesheets/tree.scss:L185"  
148 - end  
149 -  
150 - step 'merge request is mergeable' do  
151 - page.should have_content 'You can accept this request automatically'  
152 - end  
153 -  
154 - step 'I modify merge commit message' do  
155 - find('.modify-merge-commit-link').click  
156 - fill_in 'merge_commit_message', with: "wow such merge"  
157 - end  
158 -  
159 - step 'merge request "Bug NS-05" is mergeable' do  
160 - merge_request.mark_as_mergeable  
161 - end  
162 -  
163 - step 'I accept this merge request' do  
164 - click_button "Accept Merge Request"  
165 - end  
166 -  
167 - step 'I should see merged request' do  
168 - within '.issue-box' do  
169 - page.should have_content "Merged"  
170 - end  
171 - end  
172 -  
173 - def project  
174 - @project ||= Project.find_by!(name: "Shop")  
175 - end  
176 -  
177 - def merge_request  
178 - @merge_request ||= MergeRequest.find_by!(title: "Bug NS-05")  
179 - end  
180 -  
181 - def init_diff_note  
182 - find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185"]').click  
183 - end  
184 -  
185 - def leave_comment(message)  
186 - within(".js-discussion-note-form") do  
187 - fill_in "note_note", with: message  
188 - click_button "Add Comment"  
189 - end  
190 -  
191 - within ".note-text" do  
192 - page.should have_content message  
193 - end  
194 - end  
195 -end  
features/steps/project/project_milestones.rb
@@ -1,59 +0,0 @@ @@ -1,59 +0,0 @@
1 -class ProjectMilestones < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 - include SharedMarkdown  
6 -  
7 - Then 'I should see milestone "v2.2"' do  
8 - milestone = @project.milestones.find_by(title: "v2.2")  
9 - page.should have_content(milestone.title[0..10])  
10 - page.should have_content(milestone.expires_at)  
11 - page.should have_content("Browse Issues")  
12 - end  
13 -  
14 - Given 'I click link "v2.2"' do  
15 - click_link "v2.2"  
16 - end  
17 -  
18 - Given 'I click link "New Milestone"' do  
19 - click_link "New Milestone"  
20 - end  
21 -  
22 - And 'I submit new milestone "v2.3"' do  
23 - fill_in "milestone_title", with: "v2.3"  
24 - click_button "Create milestone"  
25 - end  
26 -  
27 - Then 'I should see milestone "v2.3"' do  
28 - milestone = @project.milestones.find_by(title: "v2.3")  
29 - page.should have_content(milestone.title[0..10])  
30 - page.should have_content(milestone.expires_at)  
31 - page.should have_content("Browse Issues")  
32 - end  
33 -  
34 - And 'project "Shop" has milestone "v2.2"' do  
35 - project = Project.find_by(name: "Shop")  
36 - milestone = create(:milestone,  
37 - title: "v2.2",  
38 - project: project,  
39 - description: "# Description header"  
40 - )  
41 - 3.times { create(:issue, project: project, milestone: milestone) }  
42 - end  
43 -  
44 - Given 'the milestone has open and closed issues' do  
45 - project = Project.find_by(name: "Shop")  
46 - milestone = project.milestones.find_by(title: 'v2.2')  
47 -  
48 - # 3 Open issues created above; create one closed issue  
49 - create(:closed_issue, project: project, milestone: milestone)  
50 - end  
51 -  
52 - When 'I click link "All Issues"' do  
53 - click_link 'All Issues'  
54 - end  
55 -  
56 - Then "I should see 3 issues" do  
57 - page.should have_selector('#tab-issues li', count: 4)  
58 - end  
59 -end  
features/steps/project/project_multiselect_blob.rb
@@ -1,58 +0,0 @@ @@ -1,58 +0,0 @@
1 -class ProjectMultiselectBlob < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 -  
6 - class << self  
7 - def click_line_steps(*line_numbers)  
8 - line_numbers.each do |line_number|  
9 - step "I click line #{line_number} in file" do  
10 - find("#L#{line_number}").click  
11 - end  
12 -  
13 - step "I shift-click line #{line_number} in file" do  
14 - script = "$('#L#{line_number}').trigger($.Event('click', { shiftKey: true }));"  
15 - page.evaluate_script(script)  
16 - end  
17 - end  
18 - end  
19 -  
20 - def check_state_steps(*ranges)  
21 - ranges.each do |range|  
22 - fragment = range.kind_of?(Array) ? "L#{range.first}-#{range.last}" : "L#{range}"  
23 - pluralization = range.kind_of?(Array) ? "s" : ""  
24 -  
25 - step "I should see \"#{fragment}\" as URI fragment" do  
26 - URI.parse(current_url).fragment.should == fragment  
27 - end  
28 -  
29 - step "I should see line#{pluralization} #{fragment[1..-1]} highlighted" do  
30 - ids = Array(range).map { |n| "LC#{n}" }  
31 - extra = false  
32 -  
33 - highlighted = all("#tree-content-holder .highlight .line.hll")  
34 - highlighted.each do |element|  
35 - extra ||= ids.delete(element[:id]).nil?  
36 - end  
37 -  
38 - extra.should be_false and ids.should be_empty  
39 - end  
40 - end  
41 - end  
42 - end  
43 -  
44 - click_line_steps *Array(1..5)  
45 - check_state_steps *Array(1..5), Array(1..2), Array(1..3), Array(1..4), Array(1..5), Array(3..5)  
46 -  
47 - step 'I go back in history' do  
48 - page.evaluate_script("window.history.back()")  
49 - end  
50 -  
51 - step 'I go forward in history' do  
52 - page.evaluate_script("window.history.forward()")  
53 - end  
54 -  
55 - step 'I click on "Gemfile.lock" file in repo' do  
56 - click_link "Gemfile.lock"  
57 - end  
58 -end  
59 \ No newline at end of file 0 \ No newline at end of file
features/steps/project/project_network_graph.rb
@@ -1,93 +0,0 @@ @@ -1,93 +0,0 @@
1 -class ProjectNetworkGraph < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedProject  
5 -  
6 - Then 'page should have network graph' do  
7 - page.should have_selector ".network-graph"  
8 - end  
9 -  
10 - When 'I visit project "Shop" network page' do  
11 - # Stub Graph max_size to speed up test (10 commits vs. 650)  
12 - Network::Graph.stub(max_count: 10)  
13 -  
14 - project = Project.find_by(name: "Shop")  
15 - visit project_network_path(project, "master")  
16 - end  
17 -  
18 - And 'page should select "master" in select box' do  
19 - page.should have_selector '.select2-chosen', text: "master"  
20 - end  
21 -  
22 - And 'page should select "v2.1.0" in select box' do  
23 - page.should have_selector '.select2-chosen', text: "v2.1.0"  
24 - end  
25 -  
26 - And 'page should have "master" on graph' do  
27 - within '.network-graph' do  
28 - page.should have_content 'master'  
29 - end  
30 - end  
31 -  
32 - When 'I switch ref to "stable"' do  
33 - page.select 'stable', from: 'ref'  
34 - sleep 2  
35 - end  
36 -  
37 - When 'I switch ref to "v2.1.0"' do  
38 - page.select 'v2.1.0', from: 'ref'  
39 - sleep 2  
40 - end  
41 -  
42 - When 'click "Show only selected branch" checkbox' do  
43 - find('#filter_ref').click  
44 - sleep 2  
45 - end  
46 -  
47 - Then 'page should have content not containing "v2.1.0"' do  
48 - within '.network-graph' do  
49 - page.should have_content 'cleaning'  
50 - end  
51 - end  
52 -  
53 - Then 'page should not have content not containing "v2.1.0"' do  
54 - within '.network-graph' do  
55 - page.should_not have_content 'cleaning'  
56 - end  
57 - end  
58 -  
59 - And 'page should select "stable" in select box' do  
60 - page.should have_selector '.select2-chosen', text: "stable"  
61 - end  
62 -  
63 - And 'page should select "v2.1.0" in select box' do  
64 - page.should have_selector '.select2-chosen', text: "v2.1.0"  
65 - end  
66 -  
67 - And 'page should have "stable" on graph' do  
68 - within '.network-graph' do  
69 - page.should have_content 'stable'  
70 - end  
71 - end  
72 -  
73 - When 'I looking for a commit by SHA of "v2.1.0"' do  
74 - within ".network-form" do  
75 - fill_in 'extended_sha1', with: '98d6492'  
76 - find('button').click  
77 - end  
78 - sleep 2  
79 - end  
80 -  
81 - And 'page should have "v2.1.0" on graph' do  
82 - within '.network-graph' do  
83 - page.should have_content 'v2.1.0'  
84 - end  
85 - end  
86 -  
87 - When 'I look for a commit by ";"' do  
88 - within ".network-form" do  
89 - fill_in 'extended_sha1', with: ';'  
90 - find('button').click  
91 - end  
92 - end  
93 -end  
features/steps/project/project_search_code.rb
@@ -1,17 +0,0 @@ @@ -1,17 +0,0 @@
1 -class ProjectSearchCode < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 -  
6 - When 'I search for term "Welcome to GitLab"' do  
7 - fill_in "search", with: "Welcome to GitLab"  
8 - click_button "Go"  
9 - click_link 'Repository Code'  
10 - end  
11 -  
12 - Then 'I should see files from repository containing "Welcome to GitLab"' do  
13 - page.should have_content "Welcome to GitLab"  
14 - page.should have_content "GitLab is a free project and repository management application"  
15 - end  
16 -  
17 -end  
features/steps/project/project_services.rb
@@ -1,103 +0,0 @@ @@ -1,103 +0,0 @@
1 -class ProjectServices < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 -  
6 - step 'I visit project "Shop" services page' do  
7 - visit project_services_path(@project)  
8 - end  
9 -  
10 - step 'I should see list of available services' do  
11 - page.should have_content 'Project services'  
12 - page.should have_content 'Campfire'  
13 - page.should have_content 'Hipchat'  
14 - page.should have_content 'GitLab CI'  
15 - page.should have_content 'Assembla'  
16 - end  
17 -  
18 - step 'I click gitlab-ci service link' do  
19 - click_link 'GitLab CI'  
20 - end  
21 -  
22 - step 'I fill gitlab-ci settings' do  
23 - check 'Active'  
24 - fill_in 'Project url', with: 'http://ci.gitlab.org/projects/3'  
25 - fill_in 'Token', with: 'verySecret'  
26 - click_button 'Save'  
27 - end  
28 -  
29 - step 'I should see service settings saved' do  
30 - find_field('Project url').value.should == 'http://ci.gitlab.org/projects/3'  
31 - end  
32 -  
33 - step 'I click hipchat service link' do  
34 - click_link 'Hipchat'  
35 - end  
36 -  
37 - step 'I fill hipchat settings' do  
38 - check 'Active'  
39 - fill_in 'Room', with: 'gitlab'  
40 - fill_in 'Token', with: 'verySecret'  
41 - click_button 'Save'  
42 - end  
43 -  
44 - step 'I should see hipchat service settings saved' do  
45 - find_field('Room').value.should == 'gitlab'  
46 - end  
47 -  
48 -  
49 - step 'I click pivotaltracker service link' do  
50 - click_link 'PivotalTracker'  
51 - end  
52 -  
53 - step 'I fill pivotaltracker settings' do  
54 - check 'Active'  
55 - fill_in 'Token', with: 'verySecret'  
56 - click_button 'Save'  
57 - end  
58 -  
59 - step 'I should see pivotaltracker service settings saved' do  
60 - find_field('Token').value.should == 'verySecret'  
61 - end  
62 -  
63 - step 'I click Flowdock service link' do  
64 - click_link 'Flowdock'  
65 - end  
66 -  
67 - step 'I fill Flowdock settings' do  
68 - check 'Active'  
69 - fill_in 'Token', with: 'verySecret'  
70 - click_button 'Save'  
71 - end  
72 -  
73 - step 'I should see Flowdock service settings saved' do  
74 - find_field('Token').value.should == 'verySecret'  
75 - end  
76 -  
77 - step 'I click Assembla service link' do  
78 - click_link 'Assembla'  
79 - end  
80 -  
81 - step 'I fill Assembla settings' do  
82 - check 'Active'  
83 - fill_in 'Token', with: 'verySecret'  
84 - click_button 'Save'  
85 - end  
86 -  
87 - step 'I should see Assembla service settings saved' do  
88 - find_field('Token').value.should == 'verySecret'  
89 - end  
90 -  
91 - step 'I click email on push service link' do  
92 - click_link 'Emails on push'  
93 - end  
94 -  
95 - step 'I fill email on push settings' do  
96 - fill_in 'Recipients', with: 'qa@company.name'  
97 - click_button 'Save'  
98 - end  
99 -  
100 - step 'I should see email on push service settings saved' do  
101 - find_field('Recipients').value.should == 'qa@company.name'  
102 - end  
103 -end  
features/steps/project/project_snippets.rb
@@ -1,99 +0,0 @@ @@ -1,99 +0,0 @@
1 -class ProjectSnippets < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedNote  
5 - include SharedPaths  
6 -  
7 - And 'project "Shop" have "Snippet one" snippet' do  
8 - create(:project_snippet,  
9 - title: "Snippet one",  
10 - content: "Test content",  
11 - file_name: "snippet.rb",  
12 - project: project,  
13 - author: project.users.first)  
14 - end  
15 -  
16 - And 'project "Shop" have no "Snippet two" snippet' do  
17 - create(:snippet,  
18 - title: "Snippet two",  
19 - content: "Test content",  
20 - file_name: "snippet.rb",  
21 - author: project.users.first)  
22 - end  
23 -  
24 - Given 'I click link "New Snippet"' do  
25 - click_link "Add new snippet"  
26 - end  
27 -  
28 - Given 'I click link "Snippet one"' do  
29 - click_link "Snippet one"  
30 - end  
31 -  
32 - Then 'I should see "Snippet one" in snippets' do  
33 - page.should have_content "Snippet one"  
34 - end  
35 -  
36 - And 'I should not see "Snippet two" in snippets' do  
37 - page.should_not have_content "Snippet two"  
38 - end  
39 -  
40 - And 'I should not see "Snippet one" in snippets' do  
41 - page.should_not have_content "Snippet one"  
42 - end  
43 -  
44 - And 'I click link "Edit"' do  
45 - within ".file-title" do  
46 - click_link "Edit"  
47 - end  
48 - end  
49 -  
50 - And 'I click link "Remove Snippet"' do  
51 - click_link "Remove snippet"  
52 - end  
53 -  
54 - And 'I submit new snippet "Snippet three"' do  
55 - fill_in "project_snippet_title", :with => "Snippet three"  
56 - fill_in "project_snippet_file_name", :with => "my_snippet.rb"  
57 - within('.file-editor') do  
58 - find(:xpath, "//input[@id='project_snippet_content']").set 'Content of snippet three'  
59 - end  
60 - click_button "Create snippet"  
61 - end  
62 -  
63 - Then 'I should see snippet "Snippet three"' do  
64 - page.should have_content "Snippet three"  
65 - page.should have_content "Content of snippet three"  
66 - end  
67 -  
68 - And 'I submit new title "Snippet new title"' do  
69 - fill_in "project_snippet_title", :with => "Snippet new title"  
70 - click_button "Save"  
71 - end  
72 -  
73 - Then 'I should see "Snippet new title"' do  
74 - page.should have_content "Snippet new title"  
75 - end  
76 -  
77 - And 'I leave a comment like "Good snippet!"' do  
78 - within('.js-main-target-form') do  
79 - fill_in "note_note", with: "Good snippet!"  
80 - click_button "Add Comment"  
81 - end  
82 - end  
83 -  
84 - Then 'I should see comment "Good snippet!"' do  
85 - page.should have_content "Good snippet!"  
86 - end  
87 -  
88 - And 'I visit snippet page "Snippet one"' do  
89 - visit project_snippet_path(project, project_snippet)  
90 - end  
91 -  
92 - def project  
93 - @project ||= Project.find_by!(name: "Shop")  
94 - end  
95 -  
96 - def project_snippet  
97 - @project_snippet ||= ProjectSnippet.find_by!(title: "Snippet one")  
98 - end  
99 -end  
features/steps/project/project_team_management.rb
@@ -1,107 +0,0 @@ @@ -1,107 +0,0 @@
1 -class ProjectTeamManagement < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 - include Select2Helper  
6 -  
7 - Then 'I should be able to see myself in team' do  
8 - page.should have_content(@user.name)  
9 - page.should have_content(@user.username)  
10 - end  
11 -  
12 - And 'I should see "Sam" in team list' do  
13 - user = User.find_by(name: "Sam")  
14 - page.should have_content(user.name)  
15 - page.should have_content(user.username)  
16 - end  
17 -  
18 - Given 'I click link "New Team Member"' do  
19 - click_link "New project member"  
20 - end  
21 -  
22 - And 'I select "Mike" as "Reporter"' do  
23 - user = User.find_by(name: "Mike")  
24 -  
25 - select2(user.id, from: "#user_ids", multiple: true)  
26 - within "#new_team_member" do  
27 - select "Reporter", from: "project_access"  
28 - end  
29 - click_button "Add users"  
30 - end  
31 -  
32 - Then 'I should see "Mike" in team list as "Reporter"' do  
33 - within ".access-reporter" do  
34 - page.should have_content('Mike')  
35 - end  
36 - end  
37 -  
38 - Given 'I should see "Sam" in team list as "Developer"' do  
39 - within ".access-developer" do  
40 - page.should have_content('Sam')  
41 - end  
42 - end  
43 -  
44 - And 'I change "Sam" role to "Reporter"' do  
45 - user = User.find_by(name: "Sam")  
46 - within "#user_#{user.id}" do  
47 - select "Reporter", from: "team_member_project_access"  
48 - end  
49 - end  
50 -  
51 - And 'I should see "Sam" in team list as "Reporter"' do  
52 - within ".access-reporter" do  
53 - page.should have_content('Sam')  
54 - end  
55 - end  
56 -  
57 - And 'I click link "Remove from team"' do  
58 - click_link "Remove from team"  
59 - end  
60 -  
61 - And 'I should not see "Sam" in team list' do  
62 - user = User.find_by(name: "Sam")  
63 - page.should_not have_content(user.name)  
64 - page.should_not have_content(user.username)  
65 - end  
66 -  
67 - And 'gitlab user "Mike"' do  
68 - create(:user, name: "Mike")  
69 - end  
70 -  
71 - And 'gitlab user "Sam"' do  
72 - create(:user, name: "Sam")  
73 - end  
74 -  
75 - And '"Sam" is "Shop" developer' do  
76 - user = User.find_by(name: "Sam")  
77 - project = Project.find_by(name: "Shop")  
78 - project.team << [user, :developer]  
79 - end  
80 -  
81 - Given 'I own project "Website"' do  
82 - @project = create(:empty_project, name: "Website", namespace: @user.namespace)  
83 - @project.team << [@user, :master]  
84 - end  
85 -  
86 - And '"Mike" is "Website" reporter' do  
87 - user = User.find_by(name: "Mike")  
88 - project = Project.find_by(name: "Website")  
89 - project.team << [user, :reporter]  
90 - end  
91 -  
92 - And 'I click link "Import team from another project"' do  
93 - click_link "Import members from another project"  
94 - end  
95 -  
96 - When 'I submit "Website" project for import team' do  
97 - project = Project.find_by(name: "Website")  
98 - select project.name_with_namespace, from: 'source_project_id'  
99 - click_button 'Import'  
100 - end  
101 -  
102 - step 'I click cancel link for "Sam"' do  
103 - within "#user_#{User.find_by(name: 'Sam').id}" do  
104 - click_link('Remove user from team')  
105 - end  
106 - end  
107 -end  
features/steps/project/project_wall.rb
@@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
1 -class ProjectWall < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedNote  
5 - include SharedPaths  
6 -  
7 -  
8 - Given 'I write new comment "my special test message"' do  
9 - within(".wall-note-form") do  
10 - fill_in "note[note]", with: "my special test message"  
11 - click_button "Add Comment"  
12 - end  
13 - end  
14 -  
15 - Then 'I should see project wall note "my special test message"' do  
16 - page.should have_content "my special test message"  
17 - end  
18 -end  
features/steps/project/project_wiki.rb
@@ -1,92 +0,0 @@ @@ -1,92 +0,0 @@
1 -class ProjectWiki < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedNote  
5 - include SharedPaths  
6 -  
7 - Given 'I click on the Cancel button' do  
8 - within(:css, ".form-actions") do  
9 - click_on "Cancel"  
10 - end  
11 - end  
12 -  
13 - Then 'I should be redirected back to the Edit Home Wiki page' do  
14 - url = URI.parse(current_url)  
15 - url.path.should == project_wiki_path(project, :home)  
16 - end  
17 -  
18 - Given 'I create the Wiki Home page' do  
19 - fill_in "Content", with: '[link test](test)'  
20 - click_on "Create page"  
21 - end  
22 -  
23 - Then 'I should see the newly created wiki page' do  
24 - page.should have_content "Home"  
25 - page.should have_content "link test"  
26 -  
27 - click_link "link test"  
28 - page.should have_content "Editing"  
29 - end  
30 -  
31 - Given 'I have an existing Wiki page' do  
32 - wiki.create_page("existing", "content", :markdown, "first commit")  
33 - @page = wiki.find_page("existing")  
34 - end  
35 -  
36 - And 'I browse to that Wiki page' do  
37 - visit project_wiki_path(project, @page)  
38 - end  
39 -  
40 - And 'I click on the Edit button' do  
41 - click_on "Edit"  
42 - end  
43 -  
44 - And 'I change the content' do  
45 - fill_in "Content", with: 'Updated Wiki Content'  
46 - click_on "Save changes"  
47 - end  
48 -  
49 - Then 'I should see the updated content' do  
50 - page.should have_content "Updated Wiki Content"  
51 - end  
52 -  
53 - Then 'I should be redirected back to that Wiki page' do  
54 - url = URI.parse(current_url)  
55 - url.path.should == project_wiki_path(project, @page)  
56 - end  
57 -  
58 - And 'That page has two revisions' do  
59 - @page.update("new content", :markdown, "second commit")  
60 - end  
61 -  
62 - And 'I click the History button' do  
63 - click_on "History"  
64 - end  
65 -  
66 - Then 'I should see both revisions' do  
67 - page.should have_content current_user.name  
68 - page.should have_content "first commit"  
69 - page.should have_content "second commit"  
70 - end  
71 -  
72 - And 'I click on the "Delete this page" button' do  
73 - click_on "Delete this page"  
74 - end  
75 -  
76 - Then 'The page should be deleted' do  
77 - page.should have_content "Page was successfully deleted"  
78 - end  
79 -  
80 - And 'I click on the "Pages" button' do  
81 - click_on "Pages"  
82 - end  
83 -  
84 - Then 'I should see the existing page in the pages list' do  
85 - page.should have_content current_user.name  
86 - page.should have_content @page.title.titleize  
87 - end  
88 -  
89 - def wiki  
90 - @gollum_wiki = GollumWiki.new(project, current_user)  
91 - end  
92 -end  
features/steps/project/public.rb 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +class PublicProjects < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 +
  6 + Then 'I should see the list of public projects' do
  7 + page.should have_content "Public Projects"
  8 + end
  9 +end
features/steps/project/public_projects.rb
@@ -1,9 +0,0 @@ @@ -1,9 +0,0 @@
1 -class PublicProjects < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedProject  
4 - include SharedPaths  
5 -  
6 - Then 'I should see the list of public projects' do  
7 - page.should have_content "Public Projects"  
8 - end  
9 -end  
features/steps/project/search_code.rb 0 → 100644
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
  1 +class ProjectSearchCode < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 +
  6 + When 'I search for term "Welcome to GitLab"' do
  7 + fill_in "search", with: "Welcome to GitLab"
  8 + click_button "Go"
  9 + click_link 'Repository Code'
  10 + end
  11 +
  12 + Then 'I should see files from repository containing "Welcome to GitLab"' do
  13 + page.should have_content "Welcome to GitLab"
  14 + page.should have_content "GitLab is a free project and repository management application"
  15 + end
  16 +
  17 +end
features/steps/project/services.rb 0 → 100644
@@ -0,0 +1,103 @@ @@ -0,0 +1,103 @@
  1 +class ProjectServices < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 +
  6 + step 'I visit project "Shop" services page' do
  7 + visit project_services_path(@project)
  8 + end
  9 +
  10 + step 'I should see list of available services' do
  11 + page.should have_content 'Project services'
  12 + page.should have_content 'Campfire'
  13 + page.should have_content 'Hipchat'
  14 + page.should have_content 'GitLab CI'
  15 + page.should have_content 'Assembla'
  16 + end
  17 +
  18 + step 'I click gitlab-ci service link' do
  19 + click_link 'GitLab CI'
  20 + end
  21 +
  22 + step 'I fill gitlab-ci settings' do
  23 + check 'Active'
  24 + fill_in 'Project url', with: 'http://ci.gitlab.org/projects/3'
  25 + fill_in 'Token', with: 'verySecret'
  26 + click_button 'Save'
  27 + end
  28 +
  29 + step 'I should see service settings saved' do
  30 + find_field('Project url').value.should == 'http://ci.gitlab.org/projects/3'
  31 + end
  32 +
  33 + step 'I click hipchat service link' do
  34 + click_link 'Hipchat'
  35 + end
  36 +
  37 + step 'I fill hipchat settings' do
  38 + check 'Active'
  39 + fill_in 'Room', with: 'gitlab'
  40 + fill_in 'Token', with: 'verySecret'
  41 + click_button 'Save'
  42 + end
  43 +
  44 + step 'I should see hipchat service settings saved' do
  45 + find_field('Room').value.should == 'gitlab'
  46 + end
  47 +
  48 +
  49 + step 'I click pivotaltracker service link' do
  50 + click_link 'PivotalTracker'
  51 + end
  52 +
  53 + step 'I fill pivotaltracker settings' do
  54 + check 'Active'
  55 + fill_in 'Token', with: 'verySecret'
  56 + click_button 'Save'
  57 + end
  58 +
  59 + step 'I should see pivotaltracker service settings saved' do
  60 + find_field('Token').value.should == 'verySecret'
  61 + end
  62 +
  63 + step 'I click Flowdock service link' do
  64 + click_link 'Flowdock'
  65 + end
  66 +
  67 + step 'I fill Flowdock settings' do
  68 + check 'Active'
  69 + fill_in 'Token', with: 'verySecret'
  70 + click_button 'Save'
  71 + end
  72 +
  73 + step 'I should see Flowdock service settings saved' do
  74 + find_field('Token').value.should == 'verySecret'
  75 + end
  76 +
  77 + step 'I click Assembla service link' do
  78 + click_link 'Assembla'
  79 + end
  80 +
  81 + step 'I fill Assembla settings' do
  82 + check 'Active'
  83 + fill_in 'Token', with: 'verySecret'
  84 + click_button 'Save'
  85 + end
  86 +
  87 + step 'I should see Assembla service settings saved' do
  88 + find_field('Token').value.should == 'verySecret'
  89 + end
  90 +
  91 + step 'I click email on push service link' do
  92 + click_link 'Emails on push'
  93 + end
  94 +
  95 + step 'I fill email on push settings' do
  96 + fill_in 'Recipients', with: 'qa@company.name'
  97 + click_button 'Save'
  98 + end
  99 +
  100 + step 'I should see email on push service settings saved' do
  101 + find_field('Recipients').value.should == 'qa@company.name'
  102 + end
  103 +end
features/steps/project/snippets.rb 0 → 100644
@@ -0,0 +1,99 @@ @@ -0,0 +1,99 @@
  1 +class ProjectSnippets < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedNote
  5 + include SharedPaths
  6 +
  7 + And 'project "Shop" have "Snippet one" snippet' do
  8 + create(:project_snippet,
  9 + title: "Snippet one",
  10 + content: "Test content",
  11 + file_name: "snippet.rb",
  12 + project: project,
  13 + author: project.users.first)
  14 + end
  15 +
  16 + And 'project "Shop" have no "Snippet two" snippet' do
  17 + create(:snippet,
  18 + title: "Snippet two",
  19 + content: "Test content",
  20 + file_name: "snippet.rb",
  21 + author: project.users.first)
  22 + end
  23 +
  24 + Given 'I click link "New Snippet"' do
  25 + click_link "Add new snippet"
  26 + end
  27 +
  28 + Given 'I click link "Snippet one"' do
  29 + click_link "Snippet one"
  30 + end
  31 +
  32 + Then 'I should see "Snippet one" in snippets' do
  33 + page.should have_content "Snippet one"
  34 + end
  35 +
  36 + And 'I should not see "Snippet two" in snippets' do
  37 + page.should_not have_content "Snippet two"
  38 + end
  39 +
  40 + And 'I should not see "Snippet one" in snippets' do
  41 + page.should_not have_content "Snippet one"
  42 + end
  43 +
  44 + And 'I click link "Edit"' do
  45 + within ".file-title" do
  46 + click_link "Edit"
  47 + end
  48 + end
  49 +
  50 + And 'I click link "Remove Snippet"' do
  51 + click_link "Remove snippet"
  52 + end
  53 +
  54 + And 'I submit new snippet "Snippet three"' do
  55 + fill_in "project_snippet_title", :with => "Snippet three"
  56 + fill_in "project_snippet_file_name", :with => "my_snippet.rb"
  57 + within('.file-editor') do
  58 + find(:xpath, "//input[@id='project_snippet_content']").set 'Content of snippet three'
  59 + end
  60 + click_button "Create snippet"
  61 + end
  62 +
  63 + Then 'I should see snippet "Snippet three"' do
  64 + page.should have_content "Snippet three"
  65 + page.should have_content "Content of snippet three"
  66 + end
  67 +
  68 + And 'I submit new title "Snippet new title"' do
  69 + fill_in "project_snippet_title", :with => "Snippet new title"
  70 + click_button "Save"
  71 + end
  72 +
  73 + Then 'I should see "Snippet new title"' do
  74 + page.should have_content "Snippet new title"
  75 + end
  76 +
  77 + And 'I leave a comment like "Good snippet!"' do
  78 + within('.js-main-target-form') do
  79 + fill_in "note_note", with: "Good snippet!"
  80 + click_button "Add Comment"
  81 + end
  82 + end
  83 +
  84 + Then 'I should see comment "Good snippet!"' do
  85 + page.should have_content "Good snippet!"
  86 + end
  87 +
  88 + And 'I visit snippet page "Snippet one"' do
  89 + visit project_snippet_path(project, project_snippet)
  90 + end
  91 +
  92 + def project
  93 + @project ||= Project.find_by!(name: "Shop")
  94 + end
  95 +
  96 + def project_snippet
  97 + @project_snippet ||= ProjectSnippet.find_by!(title: "Snippet one")
  98 + end
  99 +end
features/steps/project/team_management.rb 0 → 100644
@@ -0,0 +1,107 @@ @@ -0,0 +1,107 @@
  1 +class ProjectTeamManagement < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedPaths
  5 + include Select2Helper
  6 +
  7 + Then 'I should be able to see myself in team' do
  8 + page.should have_content(@user.name)
  9 + page.should have_content(@user.username)
  10 + end
  11 +
  12 + And 'I should see "Sam" in team list' do
  13 + user = User.find_by(name: "Sam")
  14 + page.should have_content(user.name)
  15 + page.should have_content(user.username)
  16 + end
  17 +
  18 + Given 'I click link "New Team Member"' do
  19 + click_link "New project member"
  20 + end
  21 +
  22 + And 'I select "Mike" as "Reporter"' do
  23 + user = User.find_by(name: "Mike")
  24 +
  25 + select2(user.id, from: "#user_ids", multiple: true)
  26 + within "#new_team_member" do
  27 + select "Reporter", from: "project_access"
  28 + end
  29 + click_button "Add users"
  30 + end
  31 +
  32 + Then 'I should see "Mike" in team list as "Reporter"' do
  33 + within ".access-reporter" do
  34 + page.should have_content('Mike')
  35 + end
  36 + end
  37 +
  38 + Given 'I should see "Sam" in team list as "Developer"' do
  39 + within ".access-developer" do
  40 + page.should have_content('Sam')
  41 + end
  42 + end
  43 +
  44 + And 'I change "Sam" role to "Reporter"' do
  45 + user = User.find_by(name: "Sam")
  46 + within "#user_#{user.id}" do
  47 + select "Reporter", from: "team_member_project_access"
  48 + end
  49 + end
  50 +
  51 + And 'I should see "Sam" in team list as "Reporter"' do
  52 + within ".access-reporter" do
  53 + page.should have_content('Sam')
  54 + end
  55 + end
  56 +
  57 + And 'I click link "Remove from team"' do
  58 + click_link "Remove from team"
  59 + end
  60 +
  61 + And 'I should not see "Sam" in team list' do
  62 + user = User.find_by(name: "Sam")
  63 + page.should_not have_content(user.name)
  64 + page.should_not have_content(user.username)
  65 + end
  66 +
  67 + And 'gitlab user "Mike"' do
  68 + create(:user, name: "Mike")
  69 + end
  70 +
  71 + And 'gitlab user "Sam"' do
  72 + create(:user, name: "Sam")
  73 + end
  74 +
  75 + And '"Sam" is "Shop" developer' do
  76 + user = User.find_by(name: "Sam")
  77 + project = Project.find_by(name: "Shop")
  78 + project.team << [user, :developer]
  79 + end
  80 +
  81 + Given 'I own project "Website"' do
  82 + @project = create(:empty_project, name: "Website", namespace: @user.namespace)
  83 + @project.team << [@user, :master]
  84 + end
  85 +
  86 + And '"Mike" is "Website" reporter' do
  87 + user = User.find_by(name: "Mike")
  88 + project = Project.find_by(name: "Website")
  89 + project.team << [user, :reporter]
  90 + end
  91 +
  92 + And 'I click link "Import team from another project"' do
  93 + click_link "Import members from another project"
  94 + end
  95 +
  96 + When 'I submit "Website" project for import team' do
  97 + project = Project.find_by(name: "Website")
  98 + select project.name_with_namespace, from: 'source_project_id'
  99 + click_button 'Import'
  100 + end
  101 +
  102 + step 'I click cancel link for "Sam"' do
  103 + within "#user_#{User.find_by(name: 'Sam').id}" do
  104 + click_link('Remove user from team')
  105 + end
  106 + end
  107 +end
features/steps/project/wall.rb 0 → 100644
@@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
  1 +class ProjectWall < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedNote
  5 + include SharedPaths
  6 +
  7 +
  8 + Given 'I write new comment "my special test message"' do
  9 + within(".wall-note-form") do
  10 + fill_in "note[note]", with: "my special test message"
  11 + click_button "Add Comment"
  12 + end
  13 + end
  14 +
  15 + Then 'I should see project wall note "my special test message"' do
  16 + page.should have_content "my special test message"
  17 + end
  18 +end
features/steps/project/wiki.rb 0 → 100644
@@ -0,0 +1,92 @@ @@ -0,0 +1,92 @@
  1 +class ProjectWiki < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedProject
  4 + include SharedNote
  5 + include SharedPaths
  6 +
  7 + Given 'I click on the Cancel button' do
  8 + within(:css, ".form-actions") do
  9 + click_on "Cancel"
  10 + end
  11 + end
  12 +
  13 + Then 'I should be redirected back to the Edit Home Wiki page' do
  14 + url = URI.parse(current_url)
  15 + url.path.should == project_wiki_path(project, :home)
  16 + end
  17 +
  18 + Given 'I create the Wiki Home page' do
  19 + fill_in "Content", with: '[link test](test)'
  20 + click_on "Create page"
  21 + end
  22 +
  23 + Then 'I should see the newly created wiki page' do
  24 + page.should have_content "Home"
  25 + page.should have_content "link test"
  26 +
  27 + click_link "link test"
  28 + page.should have_content "Editing"
  29 + end
  30 +
  31 + Given 'I have an existing Wiki page' do
  32 + wiki.create_page("existing", "content", :markdown, "first commit")
  33 + @page = wiki.find_page("existing")
  34 + end
  35 +
  36 + And 'I browse to that Wiki page' do
  37 + visit project_wiki_path(project, @page)
  38 + end
  39 +
  40 + And 'I click on the Edit button' do
  41 + click_on "Edit"
  42 + end
  43 +
  44 + And 'I change the content' do
  45 + fill_in "Content", with: 'Updated Wiki Content'
  46 + click_on "Save changes"
  47 + end
  48 +
  49 + Then 'I should see the updated content' do
  50 + page.should have_content "Updated Wiki Content"
  51 + end
  52 +
  53 + Then 'I should be redirected back to that Wiki page' do
  54 + url = URI.parse(current_url)
  55 + url.path.should == project_wiki_path(project, @page)
  56 + end
  57 +
  58 + And 'That page has two revisions' do
  59 + @page.update("new content", :markdown, "second commit")
  60 + end
  61 +
  62 + And 'I click the History button' do
  63 + click_on "History"
  64 + end
  65 +
  66 + Then 'I should see both revisions' do
  67 + page.should have_content current_user.name
  68 + page.should have_content "first commit"
  69 + page.should have_content "second commit"
  70 + end
  71 +
  72 + And 'I click on the "Delete this page" button' do
  73 + click_on "Delete this page"
  74 + end
  75 +
  76 + Then 'The page should be deleted' do
  77 + page.should have_content "Page was successfully deleted"
  78 + end
  79 +
  80 + And 'I click on the "Pages" button' do
  81 + click_on "Pages"
  82 + end
  83 +
  84 + Then 'I should see the existing page in the pages list' do
  85 + page.should have_content current_user.name
  86 + page.should have_content @page.title.titleize
  87 + end
  88 +
  89 + def wiki
  90 + @gollum_wiki = GollumWiki.new(project, current_user)
  91 + end
  92 +end
features/steps/public/projects.rb 0 → 100644
@@ -0,0 +1,172 @@ @@ -0,0 +1,172 @@
  1 +class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedProject
  5 +
  6 + step 'public empty project "Empty Public Project"' do
  7 + create :empty_project, name: 'Empty Public Project', visibility_level: Gitlab::VisibilityLevel::PUBLIC
  8 + end
  9 +
  10 + step 'I should see project "Empty Public Project"' do
  11 + page.should have_content "Empty Public Project"
  12 + end
  13 +
  14 + step 'I should see public project details' do
  15 + page.should have_content '32 branches'
  16 + page.should have_content '16 tags'
  17 + end
  18 +
  19 + step 'I should see project readme' do
  20 + page.should have_content 'README.md'
  21 + end
  22 +
  23 + step 'I visit empty project page' do
  24 + project = Project.find_by(name: 'Empty Public Project')
  25 + visit project_path(project)
  26 + end
  27 +
  28 + step 'I visit project "Community" page' do
  29 + project = Project.find_by(name: 'Community')
  30 + visit project_path(project)
  31 + end
  32 +
  33 + step 'I should see empty public project details' do
  34 + page.should have_content 'Git global setup'
  35 + end
  36 +
  37 + step 'I should see empty public project details with http clone info' do
  38 + project = Project.find_by(name: 'Empty Public Project')
  39 + page.all(:css, '.git-empty .clone').each do |element|
  40 + element.text.should include(project.http_url_to_repo)
  41 + end
  42 + end
  43 +
  44 + step 'I should see empty public project details with ssh clone info' do
  45 + project = Project.find_by(name: 'Empty Public Project')
  46 + page.all(:css, '.git-empty .clone').each do |element|
  47 + element.text.should include(project.url_to_repo)
  48 + end
  49 + end
  50 +
  51 + step 'I visit project "Enterprise" page' do
  52 + project = Project.find_by(name: 'Enterprise')
  53 + visit project_path(project)
  54 + end
  55 +
  56 + step 'I should see project "Community" home page' do
  57 + within '.project-home-title' do
  58 + page.should have_content 'Community'
  59 + end
  60 + end
  61 +
  62 + step 'I visit project "Internal" page' do
  63 + project = Project.find_by(name: 'Internal')
  64 + visit project_path(project)
  65 + end
  66 +
  67 + step 'I should see project "Internal" home page' do
  68 + within '.project-home-title' do
  69 + page.should have_content 'Internal'
  70 + end
  71 + end
  72 +
  73 + step 'I should see an http link to the repository' do
  74 + project = Project.find_by(name: 'Community')
  75 + page.should have_field('project_clone', with: project.http_url_to_repo)
  76 + end
  77 +
  78 + step 'I should see an ssh link to the repository' do
  79 + project = Project.find_by(name: 'Community')
  80 + page.should have_field('project_clone', with: project.url_to_repo)
  81 + end
  82 +
  83 + step 'I visit "Community" issues page' do
  84 + create(:issue,
  85 + title: "Bug",
  86 + project: public_project
  87 + )
  88 + create(:issue,
  89 + title: "New feature",
  90 + project: public_project
  91 + )
  92 + visit project_issues_path(public_project)
  93 + end
  94 +
  95 +
  96 + step 'I should see list of issues for "Community" project' do
  97 + page.should have_content "Bug"
  98 + page.should have_content public_project.name
  99 + page.should have_content "New feature"
  100 + end
  101 +
  102 + step 'I visit "Internal" issues page' do
  103 + create(:issue,
  104 + title: "Internal Bug",
  105 + project: internal_project
  106 + )
  107 + create(:issue,
  108 + title: "New internal feature",
  109 + project: internal_project
  110 + )
  111 + visit project_issues_path(internal_project)
  112 + end
  113 +
  114 +
  115 + step 'I should see list of issues for "Internal" project' do
  116 + page.should have_content "Internal Bug"
  117 + page.should have_content internal_project.name
  118 + page.should have_content "New internal feature"
  119 + end
  120 +
  121 + step 'I visit "Community" merge requests page' do
  122 + visit project_merge_requests_path(public_project)
  123 + end
  124 +
  125 + step 'project "Community" has "Bug fix" open merge request' do
  126 + create(:merge_request,
  127 + title: "Bug fix for public project",
  128 + source_project: public_project,
  129 + target_project: public_project,
  130 + )
  131 + end
  132 +
  133 + step 'I should see list of merge requests for "Community" project' do
  134 + page.should have_content public_project.name
  135 + page.should have_content public_merge_request.source_project.name
  136 + end
  137 +
  138 + step 'I visit "Internal" merge requests page' do
  139 + visit project_merge_requests_path(internal_project)
  140 + end
  141 +
  142 + step 'project "Internal" has "Feature implemented" open merge request' do
  143 + create(:merge_request,
  144 + title: "Feature implemented",
  145 + source_project: internal_project,
  146 + target_project: internal_project
  147 + )
  148 + end
  149 +
  150 + step 'I should see list of merge requests for "Internal" project' do
  151 + page.should have_content internal_project.name
  152 + page.should have_content internal_merge_request.source_project.name
  153 + end
  154 +
  155 + def internal_project
  156 + @internal_project ||= Project.find_by!(name: 'Internal')
  157 + end
  158 +
  159 + def public_project
  160 + @public_project ||= Project.find_by!(name: 'Community')
  161 + end
  162 +
  163 +
  164 + def internal_merge_request
  165 + @internal_merge_request ||= MergeRequest.find_by!(title: 'Feature implemented')
  166 + end
  167 +
  168 + def public_merge_request
  169 + @public_merge_request ||= MergeRequest.find_by!(title: 'Bug fix for public project')
  170 + end
  171 +end
  172 +
features/steps/public/projects_feature.rb
@@ -1,172 +0,0 @@ @@ -1,172 +0,0 @@
1 -class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedProject  
5 -  
6 - step 'public empty project "Empty Public Project"' do  
7 - create :empty_project, name: 'Empty Public Project', visibility_level: Gitlab::VisibilityLevel::PUBLIC  
8 - end  
9 -  
10 - step 'I should see project "Empty Public Project"' do  
11 - page.should have_content "Empty Public Project"  
12 - end  
13 -  
14 - step 'I should see public project details' do  
15 - page.should have_content '32 branches'  
16 - page.should have_content '16 tags'  
17 - end  
18 -  
19 - step 'I should see project readme' do  
20 - page.should have_content 'README.md'  
21 - end  
22 -  
23 - step 'I visit empty project page' do  
24 - project = Project.find_by(name: 'Empty Public Project')  
25 - visit project_path(project)  
26 - end  
27 -  
28 - step 'I visit project "Community" page' do  
29 - project = Project.find_by(name: 'Community')  
30 - visit project_path(project)  
31 - end  
32 -  
33 - step 'I should see empty public project details' do  
34 - page.should have_content 'Git global setup'  
35 - end  
36 -  
37 - step 'I should see empty public project details with http clone info' do  
38 - project = Project.find_by(name: 'Empty Public Project')  
39 - page.all(:css, '.git-empty .clone').each do |element|  
40 - element.text.should include(project.http_url_to_repo)  
41 - end  
42 - end  
43 -  
44 - step 'I should see empty public project details with ssh clone info' do  
45 - project = Project.find_by(name: 'Empty Public Project')  
46 - page.all(:css, '.git-empty .clone').each do |element|  
47 - element.text.should include(project.url_to_repo)  
48 - end  
49 - end  
50 -  
51 - step 'I visit project "Enterprise" page' do  
52 - project = Project.find_by(name: 'Enterprise')  
53 - visit project_path(project)  
54 - end  
55 -  
56 - step 'I should see project "Community" home page' do  
57 - within '.project-home-title' do  
58 - page.should have_content 'Community'  
59 - end  
60 - end  
61 -  
62 - step 'I visit project "Internal" page' do  
63 - project = Project.find_by(name: 'Internal')  
64 - visit project_path(project)  
65 - end  
66 -  
67 - step 'I should see project "Internal" home page' do  
68 - within '.project-home-title' do  
69 - page.should have_content 'Internal'  
70 - end  
71 - end  
72 -  
73 - step 'I should see an http link to the repository' do  
74 - project = Project.find_by(name: 'Community')  
75 - page.should have_field('project_clone', with: project.http_url_to_repo)  
76 - end  
77 -  
78 - step 'I should see an ssh link to the repository' do  
79 - project = Project.find_by(name: 'Community')  
80 - page.should have_field('project_clone', with: project.url_to_repo)  
81 - end  
82 -  
83 - step 'I visit "Community" issues page' do  
84 - create(:issue,  
85 - title: "Bug",  
86 - project: public_project  
87 - )  
88 - create(:issue,  
89 - title: "New feature",  
90 - project: public_project  
91 - )  
92 - visit project_issues_path(public_project)  
93 - end  
94 -  
95 -  
96 - step 'I should see list of issues for "Community" project' do  
97 - page.should have_content "Bug"  
98 - page.should have_content public_project.name  
99 - page.should have_content "New feature"  
100 - end  
101 -  
102 - step 'I visit "Internal" issues page' do  
103 - create(:issue,  
104 - title: "Internal Bug",  
105 - project: internal_project  
106 - )  
107 - create(:issue,  
108 - title: "New internal feature",  
109 - project: internal_project  
110 - )  
111 - visit project_issues_path(internal_project)  
112 - end  
113 -  
114 -  
115 - step 'I should see list of issues for "Internal" project' do  
116 - page.should have_content "Internal Bug"  
117 - page.should have_content internal_project.name  
118 - page.should have_content "New internal feature"  
119 - end  
120 -  
121 - step 'I visit "Community" merge requests page' do  
122 - visit project_merge_requests_path(public_project)  
123 - end  
124 -  
125 - step 'project "Community" has "Bug fix" open merge request' do  
126 - create(:merge_request,  
127 - title: "Bug fix for public project",  
128 - source_project: public_project,  
129 - target_project: public_project,  
130 - )  
131 - end  
132 -  
133 - step 'I should see list of merge requests for "Community" project' do  
134 - page.should have_content public_project.name  
135 - page.should have_content public_merge_request.source_project.name  
136 - end  
137 -  
138 - step 'I visit "Internal" merge requests page' do  
139 - visit project_merge_requests_path(internal_project)  
140 - end  
141 -  
142 - step 'project "Internal" has "Feature implemented" open merge request' do  
143 - create(:merge_request,  
144 - title: "Feature implemented",  
145 - source_project: internal_project,  
146 - target_project: internal_project  
147 - )  
148 - end  
149 -  
150 - step 'I should see list of merge requests for "Internal" project' do  
151 - page.should have_content internal_project.name  
152 - page.should have_content internal_merge_request.source_project.name  
153 - end  
154 -  
155 - def internal_project  
156 - @internal_project ||= Project.find_by!(name: 'Internal')  
157 - end  
158 -  
159 - def public_project  
160 - @public_project ||= Project.find_by!(name: 'Community')  
161 - end  
162 -  
163 -  
164 - def internal_merge_request  
165 - @internal_merge_request ||= MergeRequest.find_by!(title: 'Feature implemented')  
166 - end  
167 -  
168 - def public_merge_request  
169 - @public_merge_request ||= MergeRequest.find_by!(title: 'Bug fix for public project')  
170 - end  
171 -end  
172 -  
features/steps/snippets/discover.rb 0 → 100644
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
  1 +class DiscoverSnippets < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedSnippet
  5 +
  6 + Then 'I should see "Personal snippet one" in snippets' do
  7 + page.should have_content "Personal snippet one"
  8 + end
  9 +
  10 + And 'I should not see "Personal snippet private" in snippets' do
  11 + page.should_not have_content "Personal snippet private"
  12 + end
  13 +
  14 + def snippet
  15 + @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one")
  16 + end
  17 +end
features/steps/snippets/discover_snippets.rb
@@ -1,17 +0,0 @@ @@ -1,17 +0,0 @@
1 -class DiscoverSnippets < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedSnippet  
5 -  
6 - Then 'I should see "Personal snippet one" in snippets' do  
7 - page.should have_content "Personal snippet one"  
8 - end  
9 -  
10 - And 'I should not see "Personal snippet private" in snippets' do  
11 - page.should_not have_content "Personal snippet private"  
12 - end  
13 -  
14 - def snippet  
15 - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one")  
16 - end  
17 -end  
features/steps/snippets/user.rb 0 → 100644
@@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
  1 +class UserSnippets < Spinach::FeatureSteps
  2 + include SharedAuthentication
  3 + include SharedPaths
  4 + include SharedSnippet
  5 +
  6 + Given 'I visit my snippets page' do
  7 + visit user_snippets_path(current_user)
  8 + end
  9 +
  10 + Then 'I should see "Personal snippet one" in snippets' do
  11 + page.should have_content "Personal snippet one"
  12 + end
  13 +
  14 + And 'I should see "Personal snippet private" in snippets' do
  15 + page.should have_content "Personal snippet private"
  16 + end
  17 +
  18 + Then 'I should not see "Personal snippet one" in snippets' do
  19 + page.should_not have_content "Personal snippet one"
  20 + end
  21 +
  22 + And 'I should not see "Personal snippet private" in snippets' do
  23 + page.should_not have_content "Personal snippet private"
  24 + end
  25 +
  26 + Given 'I click "Public" filter' do
  27 + within('.nav-stacked') do
  28 + click_link "Public"
  29 + end
  30 + end
  31 +
  32 + Given 'I click "Private" filter' do
  33 + within('.nav-stacked') do
  34 + click_link "Private"
  35 + end
  36 + end
  37 +
  38 + def snippet
  39 + @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one")
  40 + end
  41 +end
features/steps/snippets/user_snippets.rb
@@ -1,41 +0,0 @@ @@ -1,41 +0,0 @@
1 -class UserSnippets < Spinach::FeatureSteps  
2 - include SharedAuthentication  
3 - include SharedPaths  
4 - include SharedSnippet  
5 -  
6 - Given 'I visit my snippets page' do  
7 - visit user_snippets_path(current_user)  
8 - end  
9 -  
10 - Then 'I should see "Personal snippet one" in snippets' do  
11 - page.should have_content "Personal snippet one"  
12 - end  
13 -  
14 - And 'I should see "Personal snippet private" in snippets' do  
15 - page.should have_content "Personal snippet private"  
16 - end  
17 -  
18 - Then 'I should not see "Personal snippet one" in snippets' do  
19 - page.should_not have_content "Personal snippet one"  
20 - end  
21 -  
22 - And 'I should not see "Personal snippet private" in snippets' do  
23 - page.should_not have_content "Personal snippet private"  
24 - end  
25 -  
26 - Given 'I click "Public" filter' do  
27 - within('.nav-stacked') do  
28 - click_link "Public"  
29 - end  
30 - end  
31 -  
32 - Given 'I click "Private" filter' do  
33 - within('.nav-stacked') do  
34 - click_link "Private"  
35 - end  
36 - end  
37 -  
38 - def snippet  
39 - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one")  
40 - end  
41 -end