Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8949758f
Commit
8949758f
authored
Jun 12, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rs-expect-syntax-features' into 'master'
Prepare feature steps for RSpec 3 See merge request !803
parents
b07cf118
4c42fc7c
Changes
70
Show whitespace changes
Inline
Side-by-side
Showing
70 changed files
with
831 additions
and
831 deletions
+831
-831
features/steps/admin/applications.rb
features/steps/admin/applications.rb
+11
-11
features/steps/admin/broadcast_messages.rb
features/steps/admin/broadcast_messages.rb
+5
-5
features/steps/admin/deploy_keys.rb
features/steps/admin/deploy_keys.rb
+3
-3
features/steps/admin/groups.rb
features/steps/admin/groups.rb
+11
-11
features/steps/admin/logs.rb
features/steps/admin/logs.rb
+3
-3
features/steps/admin/projects.rb
features/steps/admin/projects.rb
+6
-6
features/steps/admin/settings.rb
features/steps/admin/settings.rb
+9
-9
features/steps/admin/users.rb
features/steps/admin/users.rb
+14
-14
features/steps/dashboard/archived_projects.rb
features/steps/dashboard/archived_projects.rb
+3
-3
features/steps/dashboard/dashboard.rb
features/steps/dashboard/dashboard.rb
+13
-13
features/steps/dashboard/event_filters.rb
features/steps/dashboard/event_filters.rb
+6
-6
features/steps/dashboard/group.rb
features/steps/dashboard/group.rb
+10
-10
features/steps/dashboard/help.rb
features/steps/dashboard/help.rb
+1
-1
features/steps/dashboard/issues.rb
features/steps/dashboard/issues.rb
+2
-2
features/steps/dashboard/merge_requests.rb
features/steps/dashboard/merge_requests.rb
+2
-2
features/steps/dashboard/new_project.rb
features/steps/dashboard/new_project.rb
+6
-6
features/steps/dashboard/starred_projects.rb
features/steps/dashboard/starred_projects.rb
+2
-2
features/steps/explore/groups.rb
features/steps/explore/groups.rb
+6
-6
features/steps/explore/projects.rb
features/steps/explore/projects.rb
+25
-25
features/steps/groups.rb
features/steps/groups.rb
+38
-38
features/steps/profile/emails.rb
features/steps/profile/emails.rb
+7
-7
features/steps/profile/notifications.rb
features/steps/profile/notifications.rb
+1
-1
features/steps/profile/profile.rb
features/steps/profile/profile.rb
+41
-41
features/steps/profile/ssh_keys.rb
features/steps/profile/ssh_keys.rb
+5
-5
features/steps/project/active_tab.rb
features/steps/project/active_tab.rb
+1
-1
features/steps/project/archived.rb
features/steps/project/archived.rb
+2
-2
features/steps/project/commits/branches.rb
features/steps/project/commits/branches.rb
+11
-11
features/steps/project/commits/commits.rb
features/steps/project/commits/commits.rb
+27
-27
features/steps/project/commits/tags.rb
features/steps/project/commits/tags.rb
+13
-13
features/steps/project/commits/user_lookup.rb
features/steps/project/commits/user_lookup.rb
+3
-3
features/steps/project/create.rb
features/steps/project/create.rb
+10
-10
features/steps/project/deploy_keys.rb
features/steps/project/deploy_keys.rb
+12
-12
features/steps/project/fork.rb
features/steps/project/fork.rb
+5
-5
features/steps/project/forked_merge_requests.rb
features/steps/project/forked_merge_requests.rb
+41
-41
features/steps/project/graph.rb
features/steps/project/graph.rb
+3
-3
features/steps/project/hooks.rb
features/steps/project/hooks.rb
+7
-7
features/steps/project/issues/filter_labels.rb
features/steps/project/issues/filter_labels.rb
+9
-9
features/steps/project/issues/issues.rb
features/steps/project/issues/issues.rb
+27
-27
features/steps/project/issues/labels.rb
features/steps/project/issues/labels.rb
+19
-19
features/steps/project/issues/milestones.rb
features/steps/project/issues/milestones.rb
+7
-7
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+52
-52
features/steps/project/network_graph.rb
features/steps/project/network_graph.rb
+17
-17
features/steps/project/project.rb
features/steps/project/project.rb
+17
-17
features/steps/project/redirects.rb
features/steps/project/redirects.rb
+6
-6
features/steps/project/services.rb
features/steps/project/services.rb
+33
-33
features/steps/project/snippets.rb
features/steps/project/snippets.rb
+10
-10
features/steps/project/source/browse_files.rb
features/steps/project/source/browse_files.rb
+26
-26
features/steps/project/source/git_blame.rb
features/steps/project/source/git_blame.rb
+3
-3
features/steps/project/source/markdown_render.rb
features/steps/project/source/markdown_render.rb
+58
-58
features/steps/project/source/multiselect_blob.rb
features/steps/project/source/multiselect_blob.rb
+3
-3
features/steps/project/source/search_code.rb
features/steps/project/source/search_code.rb
+3
-3
features/steps/project/star.rb
features/steps/project/star.rb
+2
-2
features/steps/project/team_management.rb
features/steps/project/team_management.rb
+20
-20
features/steps/project/wiki.rb
features/steps/project/wiki.rb
+26
-26
features/steps/search.rb
features/steps/search.rb
+9
-9
features/steps/shared/active_tab.rb
features/steps/shared/active_tab.rb
+6
-6
features/steps/shared/authentication.rb
features/steps/shared/authentication.rb
+1
-1
features/steps/shared/diff_note.rb
features/steps/shared/diff_note.rb
+30
-30
features/steps/shared/group.rb
features/steps/shared/group.rb
+2
-2
features/steps/shared/markdown.rb
features/steps/shared/markdown.rb
+5
-5
features/steps/shared/note.rb
features/steps/shared/note.rb
+26
-26
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+4
-4
features/steps/shared/project.rb
features/steps/shared/project.rb
+10
-10
features/steps/shared/project_tab.rb
features/steps/shared/project_tab.rb
+2
-2
features/steps/snippet_search.rb
features/steps/snippet_search.rb
+9
-9
features/steps/snippets/discover.rb
features/steps/snippets/discover.rb
+3
-3
features/steps/snippets/public_snippets.rb
features/steps/snippets/public_snippets.rb
+2
-2
features/steps/snippets/snippets.rb
features/steps/snippets/snippets.rb
+7
-7
features/steps/snippets/user.rb
features/steps/snippets/user.rb
+9
-9
features/steps/user.rb
features/steps/user.rb
+3
-3
No files found.
features/steps/admin/applications.rb
View file @
8949758f
...
@@ -8,7 +8,7 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps
...
@@ -8,7 +8,7 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps
end
end
step
'I should see application form'
do
step
'I should see application form'
do
page
.
should
have_content
"New application"
expect
(
page
).
to
have_content
"New application"
end
end
step
'I fill application form out and submit'
do
step
'I fill application form out and submit'
do
...
@@ -18,9 +18,9 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps
...
@@ -18,9 +18,9 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps
end
end
step
'I see application'
do
step
'I see application'
do
page
.
should
have_content
"Application: test"
expect
(
page
).
to
have_content
"Application: test"
page
.
should
have_content
"Application Id"
expect
(
page
).
to
have_content
"Application Id"
page
.
should
have_content
"Secret"
expect
(
page
).
to
have_content
"Secret"
end
end
step
'I click edit'
do
step
'I click edit'
do
...
@@ -28,28 +28,28 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps
...
@@ -28,28 +28,28 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps
end
end
step
'I see edit application form'
do
step
'I see edit application form'
do
page
.
should
have_content
"Edit application"
expect
(
page
).
to
have_content
"Edit application"
end
end
step
'I change name of application and submit'
do
step
'I change name of application and submit'
do
page
.
should
have_content
"Edit application"
expect
(
page
).
to
have_content
"Edit application"
fill_in
:doorkeeper_application_name
,
with:
'test_changed'
fill_in
:doorkeeper_application_name
,
with:
'test_changed'
click_on
"Submit"
click_on
"Submit"
end
end
step
'I see that application was changed'
do
step
'I see that application was changed'
do
page
.
should
have_content
"test_changed"
expect
(
page
).
to
have_content
"test_changed"
page
.
should
have_content
"Application Id"
expect
(
page
).
to
have_content
"Application Id"
page
.
should
have_content
"Secret"
expect
(
page
).
to
have_content
"Secret"
end
end
step
'I click to remove application'
do
step
'I click to remove application'
do
within
'.oauth-applications'
do
page
.
within
'.oauth-applications'
do
click_on
"Destroy"
click_on
"Destroy"
end
end
end
end
step
"I see that application is removed"
do
step
"I see that application is removed"
do
page
.
find
(
".oauth-applications"
).
should_not
have_content
"test_changed"
expect
(
page
.
find
(
".oauth-applications"
)).
not_to
have_content
"test_changed"
end
end
end
end
features/steps/admin/broadcast_messages.rb
View file @
8949758f
...
@@ -8,7 +8,7 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
...
@@ -8,7 +8,7 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
end
end
step
'I should be all broadcast messages'
do
step
'I should be all broadcast messages'
do
page
.
should
have_content
"Migration to new server"
expect
(
page
).
to
have_content
"Migration to new server"
end
end
step
'submit form with new broadcast message'
do
step
'submit form with new broadcast message'
do
...
@@ -18,11 +18,11 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
...
@@ -18,11 +18,11 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
end
end
step
'I should be redirected to admin messages page'
do
step
'I should be redirected to admin messages page'
do
current_path
.
should
==
admin_broadcast_messages_path
expect
(
current_path
).
to
eq
admin_broadcast_messages_path
end
end
step
'I should see newly created broadcast message'
do
step
'I should see newly created broadcast message'
do
page
.
should
have_content
'Application update from 4:00 CST to 5:00 CST'
expect
(
page
).
to
have_content
'Application update from 4:00 CST to 5:00 CST'
end
end
step
'submit form with new customized broadcast message'
do
step
'submit form with new customized broadcast message'
do
...
@@ -35,7 +35,7 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
...
@@ -35,7 +35,7 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
end
end
step
'I should see a customized broadcast message'
do
step
'I should see a customized broadcast message'
do
page
.
should
have_content
'Application update from 4:00 CST to 5:00 CST'
expect
(
page
).
to
have_content
'Application update from 4:00 CST to 5:00 CST'
page
.
should
have_selector
%(div[style="background-color:#f2dede;color:#b94a48"])
expect
(
page
).
to
have_selector
%(div[style="background-color:#f2dede;color:#b94a48"])
end
end
end
end
features/steps/admin/deploy_keys.rb
View file @
8949758f
...
@@ -10,7 +10,7 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps
...
@@ -10,7 +10,7 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps
step
'I should see all public deploy keys'
do
step
'I should see all public deploy keys'
do
DeployKey
.
are_public
.
each
do
|
p
|
DeployKey
.
are_public
.
each
do
|
p
|
page
.
should
have_content
p
.
title
expect
(
page
).
to
have_content
p
.
title
end
end
end
end
...
@@ -33,11 +33,11 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps
...
@@ -33,11 +33,11 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps
end
end
step
'I should be on admin deploy keys page'
do
step
'I should be on admin deploy keys page'
do
current_path
.
should
==
admin_deploy_keys_path
expect
(
current_path
).
to
eq
admin_deploy_keys_path
end
end
step
'I should see newly created deploy key'
do
step
'I should see newly created deploy key'
do
page
.
should
have_content
(
deploy_key
.
title
)
expect
(
page
).
to
have_content
(
deploy_key
.
title
)
end
end
def
deploy_key
def
deploy_key
...
...
features/steps/admin/groups.rb
View file @
8949758f
...
@@ -28,32 +28,32 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
...
@@ -28,32 +28,32 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
end
end
step
'I should see newly created group'
do
step
'I should see newly created group'
do
page
.
should
have_content
"Group: gitlab"
expect
(
page
).
to
have_content
"Group: gitlab"
page
.
should
have_content
"Group description"
expect
(
page
).
to
have_content
"Group description"
end
end
step
'I should be redirected to group page'
do
step
'I should be redirected to group page'
do
current_path
.
should
==
admin_group_path
(
Group
.
find_by
(
path:
'gitlab'
))
expect
(
current_path
).
to
eq
admin_group_path
(
Group
.
find_by
(
path:
'gitlab'
))
end
end
When
'I select user "John Doe" from user list as "Reporter"'
do
When
'I select user "John Doe" from user list as "Reporter"'
do
select2
(
user_john
.
id
,
from:
"#user_ids"
,
multiple:
true
)
select2
(
user_john
.
id
,
from:
"#user_ids"
,
multiple:
true
)
within
"#new_project_member"
do
page
.
within
"#new_project_member"
do
select
"Reporter"
,
from:
"access_level"
select
"Reporter"
,
from:
"access_level"
end
end
click_button
"Add users to group"
click_button
"Add users to group"
end
end
step
'I should see "John Doe" in team list in every project as "Reporter"'
do
step
'I should see "John Doe" in team list in every project as "Reporter"'
do
within
".group-users-list"
do
page
.
within
".group-users-list"
do
page
.
should
have_content
"John Doe"
expect
(
page
).
to
have_content
"John Doe"
page
.
should
have_content
"Reporter"
expect
(
page
).
to
have_content
"Reporter"
end
end
end
end
step
'I should be all groups'
do
step
'I should be all groups'
do
Group
.
all
.
each
do
|
group
|
Group
.
all
.
each
do
|
group
|
page
.
should
have_content
group
.
name
expect
(
page
).
to
have_content
group
.
name
end
end
end
end
...
@@ -62,14 +62,14 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
...
@@ -62,14 +62,14 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
end
end
step
'I remove user "John Doe" from group'
do
step
'I remove user "John Doe" from group'
do
within
"#user_
#{
user_john
.
id
}
"
do
page
.
within
"#user_
#{
user_john
.
id
}
"
do
click_link
'Remove user from group'
click_link
'Remove user from group'
end
end
end
end
step
'I should not see "John Doe" in team list'
do
step
'I should not see "John Doe" in team list'
do
within
".group-users-list"
do
page
.
within
".group-users-list"
do
page
.
should_not
have_content
"John Doe"
expect
(
page
).
not_to
have_content
"John Doe"
end
end
end
end
...
...
features/steps/admin/logs.rb
View file @
8949758f
...
@@ -4,8 +4,8 @@ class Spinach::Features::AdminLogs < Spinach::FeatureSteps
...
@@ -4,8 +4,8 @@ class Spinach::Features::AdminLogs < Spinach::FeatureSteps
include
SharedAdmin
include
SharedAdmin
step
'I should see tabs with available logs'
do
step
'I should see tabs with available logs'
do
page
.
should
have_content
'production.log'
expect
(
page
).
to
have_content
'production.log'
page
.
should
have_content
'githost.log'
expect
(
page
).
to
have_content
'githost.log'
page
.
should
have_content
'application.log'
expect
(
page
).
to
have_content
'application.log'
end
end
end
end
features/steps/admin/projects.rb
View file @
8949758f
...
@@ -5,7 +5,7 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps
...
@@ -5,7 +5,7 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps
step
'I should see all projects'
do
step
'I should see all projects'
do
Project
.
all
.
each
do
|
p
|
Project
.
all
.
each
do
|
p
|
page
.
should
have_content
p
.
name_with_namespace
expect
(
page
).
to
have_content
p
.
name_with_namespace
end
end
end
end
...
@@ -15,9 +15,9 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps
...
@@ -15,9 +15,9 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps
step
'I should see project details'
do
step
'I should see project details'
do
project
=
Project
.
first
project
=
Project
.
first
current_path
.
should
==
admin_namespace_project_path
(
project
.
namespace
,
project
)
expect
(
current_path
).
to
eq
admin_namespace_project_path
(
project
.
namespace
,
project
)
page
.
should
have_content
(
project
.
name_with_namespace
)
expect
(
page
).
to
have_content
(
project
.
name_with_namespace
)
page
.
should
have_content
(
project
.
creator
.
name
)
expect
(
page
).
to
have_content
(
project
.
creator
.
name
)
end
end
step
'I visit admin project page'
do
step
'I visit admin project page'
do
...
@@ -34,8 +34,8 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps
...
@@ -34,8 +34,8 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps
end
end
step
'I should see project transfered'
do
step
'I should see project transfered'
do
page
.
should
have_content
'Web / '
+
project
.
name
expect
(
page
).
to
have_content
'Web / '
+
project
.
name
page
.
should
have_content
'Namespace: Web'
expect
(
page
).
to
have_content
'Namespace: Web'
end
end
def
project
def
project
...
...
features/steps/admin/settings.rb
View file @
8949758f
...
@@ -11,9 +11,9 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps
...
@@ -11,9 +11,9 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps
end
end
step
'I should see application settings saved'
do
step
'I should see application settings saved'
do
current_application_settings
.
gravatar_enabled
.
should
be_false
expect
(
current_application_settings
.
gravatar_enabled
).
to
be_false
current_application_settings
.
home_page_url
.
should
==
'https://about.gitlab.com/'
expect
(
current_application_settings
.
home_page_url
).
to
eq
'https://about.gitlab.com/'
page
.
should
have_content
'Application settings saved successfully'
expect
(
page
).
to
have_content
'Application settings saved successfully'
end
end
step
'I click on "Service Templates"'
do
step
'I click on "Service Templates"'
do
...
@@ -41,18 +41,18 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps
...
@@ -41,18 +41,18 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps
end
end
step
'I should see service template settings saved'
do
step
'I should see service template settings saved'
do
page
.
should
have_content
'Application settings saved successfully'
expect
(
page
).
to
have_content
'Application settings saved successfully'
end
end
step
'I should see all checkboxes checked'
do
step
'I should see all checkboxes checked'
do
all
(
'input[type=checkbox]'
).
each
do
|
checkbox
|
page
.
all
(
'input[type=checkbox]'
).
each
do
|
checkbox
|
checkbox
.
should
be_checked
expect
(
checkbox
).
to
be_checked
end
end
end
end
step
'I should see Slack settings saved'
do
step
'I should see Slack settings saved'
do
find_field
(
'Webhook'
).
value
.
should
eq
'http://localhost'
expect
(
find_field
(
'Webhook'
).
value
).
to
eq
'http://localhost'
find_field
(
'Username'
).
value
.
should
eq
'test_user'
expect
(
find_field
(
'Username'
).
value
).
to
eq
'test_user'
find_field
(
'Channel'
).
value
.
should
eq
'#test_channel'
expect
(
find_field
(
'Channel'
).
value
).
to
eq
'#test_channel'
end
end
end
end
features/steps/admin/users.rb
View file @
8949758f
...
@@ -5,7 +5,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
...
@@ -5,7 +5,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
step
'I should see all users'
do
step
'I should see all users'
do
User
.
all
.
each
do
|
user
|
User
.
all
.
each
do
|
user
|
page
.
should
have_content
user
.
name
expect
(
page
).
to
have_content
user
.
name
end
end
end
end
...
@@ -23,13 +23,13 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
...
@@ -23,13 +23,13 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end
end
step
'See username error message'
do
step
'See username error message'
do
within
"#error_explanation"
do
page
.
within
"#error_explanation"
do
page
.
should
have_content
"Username"
expect
(
page
).
to
have_content
"Username"
end
end
end
end
step
'Not changed form action url'
do
step
'Not changed form action url'
do
page
.
should
have_selector
%(form[action="/admin/users/#{@user.username}"])
expect
(
page
).
to
have_selector
%(form[action="/admin/users/#{@user.username}"])
end
end
step
'I submit modified user'
do
step
'I submit modified user'
do
...
@@ -38,7 +38,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
...
@@ -38,7 +38,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end
end
step
'I see user attributes changed'
do
step
'I see user attributes changed'
do
page
.
should
have_content
'Can create groups: Yes'
expect
(
page
).
to
have_content
'Can create groups: Yes'
end
end
step
'click edit on my user'
do
step
'click edit on my user'
do
...
@@ -53,7 +53,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
...
@@ -53,7 +53,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end
end
step
'I see the secondary email'
do
step
'I see the secondary email'
do
page
.
should
have_content
"Secondary email:
#{
@user_with_secondary_email
.
emails
.
last
.
email
}
"
expect
(
page
).
to
have_content
"Secondary email:
#{
@user_with_secondary_email
.
emails
.
last
.
email
}
"
end
end
step
'I click remove secondary email'
do
step
'I click remove secondary email'
do
...
@@ -61,7 +61,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
...
@@ -61,7 +61,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end
end
step
'I should not see secondary email anymore'
do
step
'I should not see secondary email anymore'
do
page
.
should_not
have_content
"Secondary email:"
expect
(
page
).
not_to
have_content
"Secondary email:"
end
end
step
'user "Mike" with groups and projects'
do
step
'user "Mike" with groups and projects'
do
...
@@ -79,8 +79,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
...
@@ -79,8 +79,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end
end
step
'I should see user "Mike" details'
do
step
'I should see user "Mike" details'
do
page
.
should
have_content
'Account'
expect
(
page
).
to
have_content
'Account'
page
.
should
have_content
'Personal projects limit'
expect
(
page
).
to
have_content
'Personal projects limit'
end
end
step
'user "Pete" with ssh keys'
do
step
'user "Pete" with ssh keys'
do
...
@@ -94,8 +94,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
...
@@ -94,8 +94,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end
end
step
'I should see key list'
do
step
'I should see key list'
do
page
.
should
have_content
'ssh-rsa Key2'
expect
(
page
).
to
have_content
'ssh-rsa Key2'
page
.
should
have_content
'ssh-rsa Key1'
expect
(
page
).
to
have_content
'ssh-rsa Key1'
end
end
step
'I click on the key title'
do
step
'I click on the key title'
do
...
@@ -103,8 +103,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
...
@@ -103,8 +103,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end
end
step
'I should see key details'
do
step
'I should see key details'
do
page
.
should
have_content
'ssh-rsa Key2'
expect
(
page
).
to
have_content
'ssh-rsa Key2'
page
.
should
have_content
'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2'
expect
(
page
).
to
have_content
'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2'
end
end
step
'I click on remove key'
do
step
'I click on remove key'
do
...
@@ -112,6 +112,6 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
...
@@ -112,6 +112,6 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end
end
step
'I should see the key removed'
do
step
'I should see the key removed'
do
page
.
should_not
have_content
'ssh-rsa Key2'
expect
(
page
).
not_to
have_content
'ssh-rsa Key2'
end
end
end
end
features/steps/dashboard/archived_projects.rb
View file @
8949758f
...
@@ -9,14 +9,14 @@ class Spinach::Features::DashboardArchivedProjects < Spinach::FeatureSteps
...
@@ -9,14 +9,14 @@ class Spinach::Features::DashboardArchivedProjects < Spinach::FeatureSteps
end
end
step
'I should see "Shop" project link'
do
step
'I should see "Shop" project link'
do
page
.
should
have_link
"Shop"
expect
(
page
).
to
have_link
"Shop"
end
end
step
'I should not see "Forum" project link'
do
step
'I should not see "Forum" project link'
do
page
.
should_not
have_link
"Forum"
expect
(
page
).
not_to
have_link
"Forum"
end
end
step
'I should see "Forum" project link'
do
step
'I should see "Forum" project link'
do
page
.
should
have_link
"Forum"
expect
(
page
).
to
have_link
"Forum"
end
end
end
end
features/steps/dashboard/dashboard.rb
View file @
8949758f
...
@@ -4,16 +4,16 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
...
@@ -4,16 +4,16 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
include
SharedProject
include
SharedProject
step
'I should see "New Project" link'
do
step
'I should see "New Project" link'
do
page
.
should
have_link
"New project"
expect
(
page
).
to
have_link
"New project"
end
end
step
'I should see "Shop" project link'
do
step
'I should see "Shop" project link'
do
page
.
should
have_link
"Shop"
expect
(
page
).
to
have_link
"Shop"
end
end
step
'I should see last push widget'
do
step
'I should see last push widget'
do
page
.
should
have_content
"You pushed to fix"
expect
(
page
).
to
have_content
"You pushed to fix"
page
.
should
have_link
"Create Merge Request"
expect
(
page
).
to
have_link
"Create Merge Request"
end
end
step
'I click "Create Merge Request" link'
do
step
'I click "Create Merge Request" link'
do
...
@@ -21,10 +21,10 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
...
@@ -21,10 +21,10 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
end
step
'I see prefilled new Merge Request page'
do
step
'I see prefilled new Merge Request page'
do
current_path
.
should
==
new_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
)
expect
(
current_path
).
to
eq
new_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
)
find
(
"#merge_request_target_project_id"
).
value
.
should
==
@project
.
id
.
to_s
expect
(
find
(
"#merge_request_target_project_id"
).
value
).
to
eq
@project
.
id
.
to_s
find
(
"input#merge_request_source_branch"
).
value
.
should
==
"fix"
expect
(
find
(
"input#merge_request_source_branch"
).
value
).
to
eq
"fix"
find
(
"input#merge_request_target_branch"
).
value
.
should
==
"master"
expect
(
find
(
"input#merge_request_target_branch"
).
value
).
to
eq
"master"
end
end
step
'user with name "John Doe" joined project "Shop"'
do
step
'user with name "John Doe" joined project "Shop"'
do
...
@@ -38,7 +38,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
...
@@ -38,7 +38,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
end
step
'I should see "John Doe joined project Shop" event'
do
step
'I should see "John Doe joined project Shop" event'
do
page
.
should
have_content
"John Doe joined project
#{
project
.
name_with_namespace
}
"
expect
(
page
).
to
have_content
"John Doe joined project
#{
project
.
name_with_namespace
}
"
end
end
step
'user with name "John Doe" left project "Shop"'
do
step
'user with name "John Doe" left project "Shop"'
do
...
@@ -51,7 +51,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
...
@@ -51,7 +51,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
end
step
'I should see "John Doe left project Shop" event'
do
step
'I should see "John Doe left project Shop" event'
do
page
.
should
have_content
"John Doe left project
#{
project
.
name_with_namespace
}
"
expect
(
page
).
to
have_content
"John Doe left project
#{
project
.
name_with_namespace
}
"
end
end
step
'I have group with projects'
do
step
'I have group with projects'
do
...
@@ -64,13 +64,13 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
...
@@ -64,13 +64,13 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
step
'I should see projects list'
do
step
'I should see projects list'
do
@user
.
authorized_projects
.
all
.
each
do
|
project
|
@user
.
authorized_projects
.
all
.
each
do
|
project
|
page
.
should
have_link
project
.
name_with_namespace
expect
(
page
).
to
have_link
project
.
name_with_namespace
end
end
end
end
step
'I should see groups list'
do
step
'I should see groups list'
do
Group
.
all
.
each
do
|
group
|
Group
.
all
.
each
do
|
group
|
page
.
should
have_link
group
.
name
expect
(
page
).
to
have_link
group
.
name
end
end
end
end
...
@@ -80,6 +80,6 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
...
@@ -80,6 +80,6 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
end
step
'I should see 1 project at group list'
do
step
'I should see 1 project at group list'
do
find
(
'span.last_activity/span'
).
should
have_content
(
'1'
)
expect
(
find
(
'span.last_activity/span'
)).
to
have_content
(
'1'
)
end
end
end
end
features/steps/dashboard/event_filters.rb
View file @
8949758f
...
@@ -4,27 +4,27 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps
...
@@ -4,27 +4,27 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps
include
SharedProject
include
SharedProject
step
'I should see push event'
do
step
'I should see push event'
do
page
.
should
have_selector
(
'span.pushed'
)
expect
(
page
).
to
have_selector
(
'span.pushed'
)
end
end
step
'I should not see push event'
do
step
'I should not see push event'
do
page
.
should_not
have_selector
(
'span.pushed'
)
expect
(
page
).
not_to
have_selector
(
'span.pushed'
)
end
end
step
'I should see new member event'
do
step
'I should see new member event'
do
page
.
should
have_selector
(
'span.joined'
)
expect
(
page
).
to
have_selector
(
'span.joined'
)
end
end
step
'I should not see new member event'
do
step
'I should not see new member event'
do
page
.
should_not
have_selector
(
'span.joined'
)
expect
(
page
).
not_to
have_selector
(
'span.joined'
)
end
end
step
'I should see merge request event'
do
step
'I should see merge request event'
do
page
.
should
have_selector
(
'span.accepted'
)
expect
(
page
).
to
have_selector
(
'span.accepted'
)
end
end
step
'I should not see merge request event'
do
step
'I should not see merge request event'
do
page
.
should_not
have_selector
(
'span.accepted'
)
expect
(
page
).
not_to
have_selector
(
'span.accepted'
)
end
end
step
'this project has push event'
do
step
'this project has push event'
do
...
...
features/steps/dashboard/group.rb
View file @
8949758f
...
@@ -17,29 +17,29 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps
...
@@ -17,29 +17,29 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps
end
end
step
'I should not see the "Leave" button for group "Owned"'
do
step
'I should not see the "Leave" button for group "Owned"'
do
find
(
:css
,
'li'
,
text:
"Owner"
).
should_not
have_selector
(
:css
,
'i.fa.fa-sign-out'
)
expect
(
find
(
:css
,
'li'
,
text:
"Owner"
)).
not_to
have_selector
(
:css
,
'i.fa.fa-sign-out'
)
# poltergeist always confirms popups.
# poltergeist always confirms popups.
end
end
step
'I should not see the "Leave" button for groupr "Guest"'
do
step
'I should not see the "Leave" button for groupr "Guest"'
do
find
(
:css
,
'li'
,
text:
"Guest"
).
should_not
have_selector
(
:css
,
'i.fa.fa-sign-out'
)
expect
(
find
(
:css
,
'li'
,
text:
"Guest"
)).
not_to
have_selector
(
:css
,
'i.fa.fa-sign-out'
)
# poltergeist always confirms popups.
# poltergeist always confirms popups.
end
end
step
'I should see group "Owned" in group list'
do
step
'I should see group "Owned" in group list'
do
page
.
should
have_content
(
"Owned"
)
expect
(
page
).
to
have_content
(
"Owned"
)
end
end
step
'I should not see group "Owned" in group list'
do
step
'I should not see group "Owned" in group list'
do
page
.
should_not
have_content
(
"Owned"
)
expect
(
page
).
not_to
have_content
(
"Owned"
)
end
end
step
'I should see group "Guest" in group list'
do
step
'I should see group "Guest" in group list'
do
page
.
should
have_content
(
"Guest"
)
expect
(
page
).
to
have_content
(
"Guest"
)
end
end
step
'I should not see group "Guest" in group list'
do
step
'I should not see group "Guest" in group list'
do
page
.
should_not
have_content
(
"Guest"
)
expect
(
page
).
not_to
have_content
(
"Guest"
)
end
end
step
'I click new group link'
do
step
'I click new group link'
do
...
@@ -53,15 +53,15 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps
...
@@ -53,15 +53,15 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps
end
end
step
'I should be redirected to group "Samurai" page'
do
step
'I should be redirected to group "Samurai" page'
do
current_path
.
should
==
group_path
(
Group
.
find_by
(
name:
'Samurai'
))
expect
(
current_path
).
to
eq
group_path
(
Group
.
find_by
(
name:
'Samurai'
))
end
end
step
'I should see newly created group "Samurai"'
do
step
'I should see newly created group "Samurai"'
do
page
.
should
have_content
"Samurai"
expect
(
page
).
to
have_content
"Samurai"
page
.
should
have_content
"Tokugawa Shogunate"
expect
(
page
).
to
have_content
"Tokugawa Shogunate"
end
end
step
'I should see the "Can not leave message"'
do
step
'I should see the "Can not leave message"'
do
page
.
should
have_content
"You can not leave Owned group because you're the last owner"
expect
(
page
).
to
have_content
"You can not leave Owned group because you're the last owner"
end
end
end
end
features/steps/dashboard/help.rb
View file @
8949758f
...
@@ -12,7 +12,7 @@ class Spinach::Features::DashboardHelp < Spinach::FeatureSteps
...
@@ -12,7 +12,7 @@ class Spinach::Features::DashboardHelp < Spinach::FeatureSteps
end
end
step
'I should see "Rake Tasks" page markdown rendered'
do
step
'I should see "Rake Tasks" page markdown rendered'
do
page
.
should
have_content
"Gather information about GitLab and the system it runs on"
expect
(
page
).
to
have_content
"Gather information about GitLab and the system it runs on"
end
end
step
'Header "Rebuild project satellites" should have correct ids and links'
do
step
'Header "Rebuild project satellites" should have correct ids and links'
do
...
...
features/steps/dashboard/issues.rb
View file @
8949758f
...
@@ -46,11 +46,11 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
...
@@ -46,11 +46,11 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
end
end
def
should_see
(
issue
)
def
should_see
(
issue
)
page
.
should
have_content
(
issue
.
title
[
0
..
10
])
expect
(
page
).
to
have_content
(
issue
.
title
[
0
..
10
])
end
end
def
should_not_see
(
issue
)
def
should_not_see
(
issue
)
page
.
should_not
have_content
(
issue
.
title
[
0
..
10
])
expect
(
page
).
not_to
have_content
(
issue
.
title
[
0
..
10
])
end
end
def
assigned_issue
def
assigned_issue
...
...
features/steps/dashboard/merge_requests.rb
View file @
8949758f
...
@@ -50,11 +50,11 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
...
@@ -50,11 +50,11 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
end
end
def
should_see
(
merge_request
)
def
should_see
(
merge_request
)
page
.
should
have_content
(
merge_request
.
title
[
0
..
10
])
expect
(
page
).
to
have_content
(
merge_request
.
title
[
0
..
10
])
end
end
def
should_not_see
(
merge_request
)
def
should_not_see
(
merge_request
)
page
.
should_not
have_content
(
merge_request
.
title
[
0
..
10
])
expect
(
page
).
not_to
have_content
(
merge_request
.
title
[
0
..
10
])
end
end
def
assigned_merge_request
def
assigned_merge_request
...
...
features/steps/dashboard/new_project.rb
View file @
8949758f
...
@@ -4,13 +4,13 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
...
@@ -4,13 +4,13 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
include
SharedProject
include
SharedProject
step
'I click "New project" link'
do
step
'I click "New project" link'
do
within
(
'.content'
)
do
page
.
within
(
'.content'
)
do
click_link
"New project"
click_link
"New project"
end
end
end
end
step
'I see "New project" page'
do
step
'I see "New project" page'
do
page
.
should
have_content
(
"Project path"
)
expect
(
page
).
to
have_content
(
"Project path"
)
end
end
step
'I click on "Import project from GitHub"'
do
step
'I click on "Import project from GitHub"'
do
...
@@ -19,11 +19,11 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
...
@@ -19,11 +19,11 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
step
'I see instructions on how to import from GitHub'
do
step
'I see instructions on how to import from GitHub'
do
github_modal
=
first
(
'.modal-body'
)
github_modal
=
first
(
'.modal-body'
)
github_modal
.
should
be_visible
expect
(
github_modal
).
to
be_visible
github_modal
.
should
have_content
"To enable importing projects from GitHub"
expect
(
github_modal
).
to
have_content
"To enable importing projects from GitHub"
all
(
'.modal-body'
).
each
do
|
element
|
page
.
all
(
'.modal-body'
).
each
do
|
element
|
e
lement
.
should_not
be_visible
unless
element
==
github_modal
e
xpect
(
element
).
not_to
be_visible
unless
element
==
github_modal
end
end
end
end
end
end
features/steps/dashboard/starred_projects.rb
View file @
8949758f
...
@@ -8,8 +8,8 @@ class Spinach::Features::DashboardStarredProjects < Spinach::FeatureSteps
...
@@ -8,8 +8,8 @@ class Spinach::Features::DashboardStarredProjects < Spinach::FeatureSteps
end
end
step
'I should not see project "Shop"'
do
step
'I should not see project "Shop"'
do
within
'aside'
do
page
.
within
'aside'
do
page
.
should_not
have_content
(
'Shop'
)
expect
(
page
).
not_to
have_content
(
'Shop'
)
end
end
end
end
end
end
features/steps/explore/groups.rb
View file @
8949758f
...
@@ -39,19 +39,19 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps
...
@@ -39,19 +39,19 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps
end
end
step
'I should not see project "Enterprise" items'
do
step
'I should not see project "Enterprise" items'
do
page
.
should_not
have_content
"Enterprise"
expect
(
page
).
not_to
have_content
"Enterprise"
end
end
step
'I should see project "Internal" items'
do
step
'I should see project "Internal" items'
do
page
.
should
have_content
"Internal"
expect
(
page
).
to
have_content
"Internal"
end
end
step
'I should not see project "Internal" items'
do
step
'I should not see project "Internal" items'
do
page
.
should_not
have_content
"Internal"
expect
(
page
).
not_to
have_content
"Internal"
end
end
step
'I should see project "Community" items'
do
step
'I should see project "Community" items'
do
page
.
should
have_content
"Community"
expect
(
page
).
to
have_content
"Community"
end
end
step
'I change filter to Everyone\'s'
do
step
'I change filter to Everyone\'s'
do
...
@@ -59,11 +59,11 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps
...
@@ -59,11 +59,11 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps
end
end
step
'I should see group member "John Doe"'
do
step
'I should see group member "John Doe"'
do
page
.
should
have_content
"John Doe"
expect
(
page
).
to
have_content
"John Doe"
end
end
step
'I should not see member roles'
do
step
'I should not see member roles'
do
body
.
should_not
match
(
%r{owner|developer|reporter|guest}i
)
expect
(
body
).
not_to
match
(
%r{owner|developer|reporter|guest}i
)
end
end
protected
protected
...
...
features/steps/explore/projects.rb
View file @
8949758f
...
@@ -4,56 +4,56 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
...
@@ -4,56 +4,56 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
include
SharedProject
include
SharedProject
step
'I should see project "Empty Public Project"'
do
step
'I should see project "Empty Public Project"'
do
page
.
should
have_content
"Empty Public Project"
expect
(
page
).
to
have_content
"Empty Public Project"
end
end
step
'I should see public project details'
do
step
'I should see public project details'
do
page
.
should
have_content
'32 branches'
expect
(
page
).
to
have_content
'32 branches'
page
.
should
have_content
'16 tags'
expect
(
page
).
to
have_content
'16 tags'
end
end
step
'I should see project readme'
do
step
'I should see project readme'
do
page
.
should
have_content
'README.md'
expect
(
page
).
to
have_content
'README.md'
end
end
step
'I should see empty public project details'
do
step
'I should see empty public project details'
do
page
.
should
have_content
'Git global setup'
expect
(
page
).
to
have_content
'Git global setup'
end
end
step
'I should see empty public project details with http clone info'
do
step
'I should see empty public project details with http clone info'
do
project
=
Project
.
find_by
(
name:
'Empty Public Project'
)
project
=
Project
.
find_by
(
name:
'Empty Public Project'
)
all
(
:css
,
'.git-empty .clone'
).
each
do
|
element
|
page
.
all
(
:css
,
'.git-empty .clone'
).
each
do
|
element
|
e
lement
.
text
.
should
include
(
project
.
http_url_to_repo
)
e
xpect
(
element
.
text
).
to
include
(
project
.
http_url_to_repo
)
end
end
end
end
step
'I should see empty public project details with ssh clone info'
do
step
'I should see empty public project details with ssh clone info'
do
project
=
Project
.
find_by
(
name:
'Empty Public Project'
)
project
=
Project
.
find_by
(
name:
'Empty Public Project'
)
all
(
:css
,
'.git-empty .clone'
).
each
do
|
element
|
page
.
all
(
:css
,
'.git-empty .clone'
).
each
do
|
element
|
e
lement
.
text
.
should
include
(
project
.
url_to_repo
)
e
xpect
(
element
.
text
).
to
include
(
project
.
url_to_repo
)
end
end
end
end
step
'I should see project "Community" home page'
do
step
'I should see project "Community" home page'
do
within
'.navbar-gitlab .title'
do
page
.
within
'.navbar-gitlab .title'
do
page
.
should
have_content
'Community'
expect
(
page
).
to
have_content
'Community'
end
end
end
end
step
'I should see project "Internal" home page'
do
step
'I should see project "Internal" home page'
do
within
'.navbar-gitlab .title'
do
page
.
within
'.navbar-gitlab .title'
do
page
.
should
have_content
'Internal'
expect
(
page
).
to
have_content
'Internal'
end
end
end
end
step
'I should see an http link to the repository'
do
step
'I should see an http link to the repository'
do
project
=
Project
.
find_by
(
name:
'Community'
)
project
=
Project
.
find_by
(
name:
'Community'
)
page
.
should
have_field
(
'project_clone'
,
with:
project
.
http_url_to_repo
)
expect
(
page
).
to
have_field
(
'project_clone'
,
with:
project
.
http_url_to_repo
)
end
end
step
'I should see an ssh link to the repository'
do
step
'I should see an ssh link to the repository'
do
project
=
Project
.
find_by
(
name:
'Community'
)
project
=
Project
.
find_by
(
name:
'Community'
)
page
.
should
have_field
(
'project_clone'
,
with:
project
.
url_to_repo
)
expect
(
page
).
to
have_field
(
'project_clone'
,
with:
project
.
url_to_repo
)
end
end
step
'I visit "Community" issues page'
do
step
'I visit "Community" issues page'
do
...
@@ -70,9 +70,9 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
...
@@ -70,9 +70,9 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
step
'I should see list of issues for "Community" project'
do
step
'I should see list of issues for "Community" project'
do
page
.
should
have_content
"Bug"
expect
(
page
).
to
have_content
"Bug"
page
.
should
have_content
public_project
.
name
expect
(
page
).
to
have_content
public_project
.
name
page
.
should
have_content
"New feature"
expect
(
page
).
to
have_content
"New feature"
end
end
step
'I visit "Internal" issues page'
do
step
'I visit "Internal" issues page'
do
...
@@ -89,9 +89,9 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
...
@@ -89,9 +89,9 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
step
'I should see list of issues for "Internal" project'
do
step
'I should see list of issues for "Internal" project'
do
page
.
should
have_content
"Internal Bug"
expect
(
page
).
to
have_content
"Internal Bug"
page
.
should
have_content
internal_project
.
name
expect
(
page
).
to
have_content
internal_project
.
name
page
.
should
have_content
"New internal feature"
expect
(
page
).
to
have_content
"New internal feature"
end
end
step
'I visit "Community" merge requests page'
do
step
'I visit "Community" merge requests page'
do
...
@@ -107,8 +107,8 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
...
@@ -107,8 +107,8 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
end
end
step
'I should see list of merge requests for "Community" project'
do
step
'I should see list of merge requests for "Community" project'
do
page
.
should
have_content
public_project
.
name
expect
(
page
).
to
have_content
public_project
.
name
page
.
should
have_content
public_merge_request
.
source_project
.
name
expect
(
page
).
to
have_content
public_merge_request
.
source_project
.
name
end
end
step
'I visit "Internal" merge requests page'
do
step
'I visit "Internal" merge requests page'
do
...
@@ -124,8 +124,8 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
...
@@ -124,8 +124,8 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
end
end
step
'I should see list of merge requests for "Internal" project'
do
step
'I should see list of merge requests for "Internal" project'
do
page
.
should
have_content
internal_project
.
name
expect
(
page
).
to
have_content
internal_project
.
name
page
.
should
have_content
internal_merge_request
.
source_project
.
name
expect
(
page
).
to
have_content
internal_merge_request
.
source_project
.
name
end
end
def
internal_project
def
internal_project
...
...
features/steps/groups.rb
View file @
8949758f
...
@@ -16,7 +16,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -16,7 +16,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step
'I select "Mike" as "Reporter"'
do
step
'I select "Mike" as "Reporter"'
do
user
=
User
.
find_by
(
name:
"Mike"
)
user
=
User
.
find_by
(
name:
"Mike"
)
within
".users-group-form"
do
page
.
within
".users-group-form"
do
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
select
"Reporter"
,
from:
"access_level"
select
"Reporter"
,
from:
"access_level"
end
end
...
@@ -25,14 +25,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -25,14 +25,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should see "Mike" in team list as "Reporter"'
do
step
'I should see "Mike" in team list as "Reporter"'
do
within
'.well-list'
do
page
.
within
'.well-list'
do
page
.
should
have_content
(
'Mike'
)
expect
(
page
).
to
have_content
(
'Mike'
)
page
.
should
have_content
(
'Reporter'
)
expect
(
page
).
to
have_content
(
'Reporter'
)
end
end
end
end
step
'I select "sjobs@apple.com" as "Reporter"'
do
step
'I select "sjobs@apple.com" as "Reporter"'
do
within
".users-group-form"
do
page
.
within
".users-group-form"
do
select2
(
"sjobs@apple.com"
,
from:
"#user_ids"
,
multiple:
true
)
select2
(
"sjobs@apple.com"
,
from:
"#user_ids"
,
multiple:
true
)
select
"Reporter"
,
from:
"access_level"
select
"Reporter"
,
from:
"access_level"
end
end
...
@@ -41,39 +41,39 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -41,39 +41,39 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should see "sjobs@apple.com" in team list as invited "Reporter"'
do
step
'I should see "sjobs@apple.com" in team list as invited "Reporter"'
do
within
'.well-list'
do
page
.
within
'.well-list'
do
page
.
should
have_content
(
'sjobs@apple.com'
)
expect
(
page
).
to
have_content
(
'sjobs@apple.com'
)
page
.
should
have_content
(
'invited'
)
expect
(
page
).
to
have_content
(
'invited'
)
page
.
should
have_content
(
'Reporter'
)
expect
(
page
).
to
have_content
(
'Reporter'
)
end
end
end
end
step
'I should see group "Owned" projects list'
do
step
'I should see group "Owned" projects list'
do
Group
.
find_by
(
name:
"Owned"
).
projects
.
each
do
|
project
|
Group
.
find_by
(
name:
"Owned"
).
projects
.
each
do
|
project
|
page
.
should
have_link
project
.
name
expect
(
page
).
to
have_link
project
.
name
end
end
end
end
step
'I should see projects activity feed'
do
step
'I should see projects activity feed'
do
page
.
should
have_content
'closed issue'
expect
(
page
).
to
have_content
'closed issue'
end
end
step
'I should see issues from group "Owned" assigned to me'
do
step
'I should see issues from group "Owned" assigned to me'
do
assigned_to_me
(
:issues
).
each
do
|
issue
|
assigned_to_me
(
:issues
).
each
do
|
issue
|
page
.
should
have_content
issue
.
title
expect
(
page
).
to
have_content
issue
.
title
end
end
end
end
step
'I should see merge requests from group "Owned" assigned to me'
do
step
'I should see merge requests from group "Owned" assigned to me'
do
assigned_to_me
(
:merge_requests
).
each
do
|
issue
|
assigned_to_me
(
:merge_requests
).
each
do
|
issue
|
page
.
should
have_content
issue
.
title
[
0
..
80
]
expect
(
page
).
to
have_content
issue
.
title
[
0
..
80
]
end
end
end
end
step
'I select user "Mary Jane" from list with role "Reporter"'
do
step
'I select user "Mary Jane" from list with role "Reporter"'
do
user
=
User
.
find_by
(
name:
"Mary Jane"
)
||
create
(
:user
,
name:
"Mary Jane"
)
user
=
User
.
find_by
(
name:
"Mary Jane"
)
||
create
(
:user
,
name:
"Mary Jane"
)
click_button
'Add members'
click_button
'Add members'
within
".users-group-form"
do
page
.
within
".users-group-form"
do
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
select
"Reporter"
,
from:
"access_level"
select
"Reporter"
,
from:
"access_level"
end
end
...
@@ -82,22 +82,22 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -82,22 +82,22 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step
'I should see user "John Doe" in team list'
do
step
'I should see user "John Doe" in team list'
do
projects_with_access
=
find
(
".panel .well-list"
)
projects_with_access
=
find
(
".panel .well-list"
)
projects_with_access
.
should
have_content
(
"John Doe"
)
expect
(
projects_with_access
).
to
have_content
(
"John Doe"
)
end
end
step
'I should not see user "John Doe" in team list'
do
step
'I should not see user "John Doe" in team list'
do
projects_with_access
=
find
(
".panel .well-list"
)
projects_with_access
=
find
(
".panel .well-list"
)
projects_with_access
.
should_not
have_content
(
"John Doe"
)
expect
(
projects_with_access
).
not_to
have_content
(
"John Doe"
)
end
end
step
'I should see user "Mary Jane" in team list'
do
step
'I should see user "Mary Jane" in team list'
do
projects_with_access
=
find
(
".panel .well-list"
)
projects_with_access
=
find
(
".panel .well-list"
)
projects_with_access
.
should
have_content
(
"Mary Jane"
)
expect
(
projects_with_access
).
to
have_content
(
"Mary Jane"
)
end
end
step
'I should not see user "Mary Jane" in team list'
do
step
'I should not see user "Mary Jane" in team list'
do
projects_with_access
=
find
(
".panel .well-list"
)
projects_with_access
=
find
(
".panel .well-list"
)
projects_with_access
.
should_not
have_content
(
"Mary Jane"
)
expect
(
projects_with_access
).
not_to
have_content
(
"Mary Jane"
)
end
end
step
'project from group "Owned" has issues assigned to me'
do
step
'project from group "Owned" has issues assigned to me'
do
...
@@ -122,8 +122,8 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -122,8 +122,8 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should see new group "Owned" name'
do
step
'I should see new group "Owned" name'
do
within
".navbar-gitlab"
do
page
.
within
".navbar-gitlab"
do
page
.
should
have_content
"new-name"
expect
(
page
).
to
have_content
"new-name"
end
end
end
end
...
@@ -134,12 +134,12 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -134,12 +134,12 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should see new group "Owned" avatar'
do
step
'I should see new group "Owned" avatar'
do
Group
.
find_by
(
name:
"Owned"
).
avatar
.
should
be_instance_of
AvatarUploader
expect
(
Group
.
find_by
(
name:
"Owned"
).
avatar
).
to
be_instance_of
AvatarUploader
Group
.
find_by
(
name:
"Owned"
).
avatar
.
url
.
should
==
"/uploads/group/avatar/
#{
Group
.
find_by
(
name
:"Owned"
).
id
}
/gitlab_logo.png"
expect
(
Group
.
find_by
(
name:
"Owned"
).
avatar
.
url
).
to
eq
"/uploads/group/avatar/
#{
Group
.
find_by
(
name
:"Owned"
).
id
}
/gitlab_logo.png"
end
end
step
'I should see the "Remove avatar" button'
do
step
'I should see the "Remove avatar" button'
do
page
.
should
have_link
(
"Remove avatar"
)
expect
(
page
).
to
have_link
(
"Remove avatar"
)
end
end
step
'I have group "Owned" avatar'
do
step
'I have group "Owned" avatar'
do
...
@@ -154,11 +154,11 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -154,11 +154,11 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should not see group "Owned" avatar'
do
step
'I should not see group "Owned" avatar'
do
Group
.
find_by
(
name:
"Owned"
).
avatar?
.
should
be_false
expect
(
Group
.
find_by
(
name:
"Owned"
).
avatar?
).
to
be_false
end
end
step
'I should not see the "Remove avatar" button'
do
step
'I should not see the "Remove avatar" button'
do
page
.
should_not
have_link
(
"Remove avatar"
)
expect
(
page
).
not_to
have_link
(
"Remove avatar"
)
end
end
step
'I click on the "Remove User From Group" button for "John Doe"'
do
step
'I click on the "Remove User From Group" button for "John Doe"'
do
...
@@ -172,17 +172,17 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -172,17 +172,17 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should not see the "Remove User From Group" button for "John Doe"'
do
step
'I should not see the "Remove User From Group" button for "John Doe"'
do
find
(
:css
,
'li'
,
text:
"John Doe"
).
should_not
have_selector
(
:css
,
'a.btn-remove'
)
expect
(
find
(
:css
,
'li'
,
text:
"John Doe"
)).
not_to
have_selector
(
:css
,
'a.btn-remove'
)
# poltergeist always confirms popups.
# poltergeist always confirms popups.
end
end
step
'I should not see the "Remove User From Group" button for "Mary Jane"'
do
step
'I should not see the "Remove User From Group" button for "Mary Jane"'
do
find
(
:css
,
'li'
,
text:
"Mary Jane"
).
should_not
have_selector
(
:css
,
'a.btn-remove'
)
expect
(
find
(
:css
,
'li'
,
text:
"Mary Jane"
)).
not_to
have_selector
(
:css
,
'a.btn-remove'
)
# poltergeist always confirms popups.
# poltergeist always confirms popups.
end
end
step
'I search for \'Mary\' member'
do
step
'I search for \'Mary\' member'
do
within
'.member-search-form'
do
page
.
within
'.member-search-form'
do
fill_in
'search'
,
with:
'Mary'
fill_in
'search'
,
with:
'Mary'
click_button
'Search'
click_button
'Search'
end
end
...
@@ -193,7 +193,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -193,7 +193,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should see group milestones index page has no milestones'
do
step
'I should see group milestones index page has no milestones'
do
page
.
should
have_content
(
'No milestones to show'
)
expect
(
page
).
to
have_content
(
'No milestones to show'
)
end
end
step
'Group has projects with milestones'
do
step
'Group has projects with milestones'
do
...
@@ -201,10 +201,10 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -201,10 +201,10 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should see group milestones index page with milestones'
do
step
'I should see group milestones index page with milestones'
do
page
.
should
have_content
(
'Version 7.2'
)
expect
(
page
).
to
have_content
(
'Version 7.2'
)
page
.
should
have_content
(
'GL-113'
)
expect
(
page
).
to
have_content
(
'GL-113'
)
page
.
should
have_link
(
'2 Issues'
,
href:
issues_group_path
(
"owned"
,
milestone_title:
"Version 7.2"
))
expect
(
page
).
to
have_link
(
'2 Issues'
,
href:
issues_group_path
(
"owned"
,
milestone_title:
"Version 7.2"
))
page
.
should
have_link
(
'3 Merge Requests'
,
href:
merge_requests_group_path
(
"owned"
,
milestone_title:
"GL-113"
))
expect
(
page
).
to
have_link
(
'3 Merge Requests'
,
href:
merge_requests_group_path
(
"owned"
,
milestone_title:
"GL-113"
))
end
end
step
'I click on one group milestone'
do
step
'I click on one group milestone'
do
...
@@ -212,14 +212,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
...
@@ -212,14 +212,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
end
step
'I should see group milestone with descriptions and expiry date'
do
step
'I should see group milestone with descriptions and expiry date'
do
page
.
should
have_content
(
'expires at Aug 20, 2114'
)
expect
(
page
).
to
have_content
(
'expires at Aug 20, 2114'
)
end
end
step
'I should see group milestone with all issues and MRs assigned to that milestone'
do
step
'I should see group milestone with all issues and MRs assigned to that milestone'
do
page
.
should
have_content
(
'Milestone GL-113'
)
expect
(
page
).
to
have_content
(
'Milestone GL-113'
)
page
.
should
have_content
(
'Progress: 0 closed – 4 open'
)
expect
(
page
).
to
have_content
(
'Progress: 0 closed – 4 open'
)
page
.
should
have_link
(
@issue1
.
title
,
href:
namespace_project_issue_path
(
@project1
.
namespace
,
@project1
,
@issue1
))
expect
(
page
).
to
have_link
(
@issue1
.
title
,
href:
namespace_project_issue_path
(
@project1
.
namespace
,
@project1
,
@issue1
))
page
.
should
have_link
(
@mr3
.
title
,
href:
namespace_project_merge_request_path
(
@project3
.
namespace
,
@project3
,
@mr3
))
expect
(
page
).
to
have_link
(
@mr3
.
title
,
href:
namespace_project_merge_request_path
(
@project3
.
namespace
,
@project3
,
@mr3
))
end
end
protected
protected
...
...
features/steps/profile/emails.rb
View file @
8949758f
...
@@ -6,9 +6,9 @@ class Spinach::Features::ProfileEmails < Spinach::FeatureSteps
...
@@ -6,9 +6,9 @@ class Spinach::Features::ProfileEmails < Spinach::FeatureSteps
end
end
step
'I should see my emails'
do
step
'I should see my emails'
do
page
.
should
have_content
(
@user
.
email
)
expect
(
page
).
to
have_content
(
@user
.
email
)
@user
.
emails
.
each
do
|
email
|
@user
.
emails
.
each
do
|
email
|
page
.
should
have_content
(
email
.
email
)
expect
(
page
).
to
have_content
(
email
.
email
)
end
end
end
end
...
@@ -19,14 +19,14 @@ class Spinach::Features::ProfileEmails < Spinach::FeatureSteps
...
@@ -19,14 +19,14 @@ class Spinach::Features::ProfileEmails < Spinach::FeatureSteps
step
'I should see new email "my@email.com"'
do
step
'I should see new email "my@email.com"'
do
email
=
@user
.
emails
.
find_by
(
email:
"my@email.com"
)
email
=
@user
.
emails
.
find_by
(
email:
"my@email.com"
)
e
mail
.
should_not
be_nil
e
xpect
(
email
).
not_to
be_nil
page
.
should
have_content
(
"my@email.com"
)
expect
(
page
).
to
have_content
(
"my@email.com"
)
end
end
step
'I should not see email "my@email.com"'
do
step
'I should not see email "my@email.com"'
do
email
=
@user
.
emails
.
find_by
(
email:
"my@email.com"
)
email
=
@user
.
emails
.
find_by
(
email:
"my@email.com"
)
e
mail
.
should
be_nil
e
xpect
(
email
).
to
be_nil
page
.
should_not
have_content
(
"my@email.com"
)
expect
(
page
).
not_to
have_content
(
"my@email.com"
)
end
end
step
'I click link "Remove" for "my@email.com"'
do
step
'I click link "Remove" for "my@email.com"'
do
...
@@ -43,6 +43,6 @@ class Spinach::Features::ProfileEmails < Spinach::FeatureSteps
...
@@ -43,6 +43,6 @@ class Spinach::Features::ProfileEmails < Spinach::FeatureSteps
step
'I should not have @user.email added'
do
step
'I should not have @user.email added'
do
email
=
@user
.
emails
.
find_by
(
email:
@user
.
email
)
email
=
@user
.
emails
.
find_by
(
email:
@user
.
email
)
e
mail
.
should
be_nil
e
xpect
(
email
).
to
be_nil
end
end
end
end
features/steps/profile/notifications.rb
View file @
8949758f
...
@@ -7,6 +7,6 @@ class Spinach::Features::ProfileNotifications < Spinach::FeatureSteps
...
@@ -7,6 +7,6 @@ class Spinach::Features::ProfileNotifications < Spinach::FeatureSteps
end
end
step
'I should see global notifications settings'
do
step
'I should see global notifications settings'
do
page
.
should
have_content
"Notifications"
expect
(
page
).
to
have_content
"Notifications"
end
end
end
end
features/steps/profile/profile.rb
View file @
8949758f
...
@@ -3,7 +3,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -3,7 +3,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
include
SharedPaths
include
SharedPaths
step
'I should see my profile info'
do
step
'I should see my profile info'
do
page
.
should
have_content
"This information will appear on your profile"
expect
(
page
).
to
have_content
"This information will appear on your profile"
end
end
step
'I change my profile info'
do
step
'I change my profile info'
do
...
@@ -23,7 +23,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -23,7 +23,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
expect
(
@user
.
twitter
).
to
eq
'testtwitter'
expect
(
@user
.
twitter
).
to
eq
'testtwitter'
expect
(
@user
.
website_url
).
to
eq
'testurl'
expect
(
@user
.
website_url
).
to
eq
'testurl'
expect
(
@user
.
bio
).
to
eq
'I <3 GitLab'
expect
(
@user
.
bio
).
to
eq
'I <3 GitLab'
find
(
'#user_location'
).
value
.
should
==
'Ukraine'
expect
(
find
(
'#user_location'
).
value
).
to
eq
'Ukraine'
end
end
step
'I change my avatar'
do
step
'I change my avatar'
do
...
@@ -33,12 +33,12 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -33,12 +33,12 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
'I should see new avatar'
do
step
'I should see new avatar'
do
@user
.
avatar
.
should
be_instance_of
AvatarUploader
expect
(
@user
.
avatar
).
to
be_instance_of
AvatarUploader
@user
.
avatar
.
url
.
should
==
"/uploads/user/avatar/
#{
@user
.
id
}
/gitlab_logo.png"
expect
(
@user
.
avatar
.
url
).
to
eq
"/uploads/user/avatar/
#{
@user
.
id
}
/gitlab_logo.png"
end
end
step
'I should see the "Remove avatar" button'
do
step
'I should see the "Remove avatar" button'
do
page
.
should
have_link
(
"Remove avatar"
)
expect
(
page
).
to
have_link
(
"Remove avatar"
)
end
end
step
'I have an avatar'
do
step
'I have an avatar'
do
...
@@ -53,15 +53,15 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -53,15 +53,15 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
'I should see my gravatar'
do
step
'I should see my gravatar'
do
@user
.
avatar?
.
should
be_false
expect
(
@user
.
avatar?
).
to
be_false
end
end
step
'I should not see the "Remove avatar" button'
do
step
'I should not see the "Remove avatar" button'
do
page
.
should_not
have_link
(
"Remove avatar"
)
expect
(
page
).
not_to
have_link
(
"Remove avatar"
)
end
end
step
'I try change my password w/o old one'
do
step
'I try change my password w/o old one'
do
within
'.update-password'
do
page
.
within
'.update-password'
do
fill_in
"user_password"
,
with:
"22233344"
fill_in
"user_password"
,
with:
"22233344"
fill_in
"user_password_confirmation"
,
with:
"22233344"
fill_in
"user_password_confirmation"
,
with:
"22233344"
click_button
"Save"
click_button
"Save"
...
@@ -69,7 +69,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -69,7 +69,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
'I change my password'
do
step
'I change my password'
do
within
'.update-password'
do
page
.
within
'.update-password'
do
fill_in
"user_current_password"
,
with:
"12345678"
fill_in
"user_current_password"
,
with:
"12345678"
fill_in
"user_password"
,
with:
"22233344"
fill_in
"user_password"
,
with:
"22233344"
fill_in
"user_password_confirmation"
,
with:
"22233344"
fill_in
"user_password_confirmation"
,
with:
"22233344"
...
@@ -78,7 +78,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -78,7 +78,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
'I unsuccessfully change my password'
do
step
'I unsuccessfully change my password'
do
within
'.update-password'
do
page
.
within
'.update-password'
do
fill_in
"user_current_password"
,
with:
"12345678"
fill_in
"user_current_password"
,
with:
"12345678"
fill_in
"user_password"
,
with:
"password"
fill_in
"user_password"
,
with:
"password"
fill_in
"user_password_confirmation"
,
with:
"confirmation"
fill_in
"user_password_confirmation"
,
with:
"confirmation"
...
@@ -87,23 +87,23 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -87,23 +87,23 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
"I should see a missing password error message"
do
step
"I should see a missing password error message"
do
page
.
should
have_content
"You must provide a valid current password"
expect
(
page
).
to
have_content
"You must provide a valid current password"
end
end
step
"I should see a password error message"
do
step
"I should see a password error message"
do
page
.
should
have_content
"Password confirmation doesn't match"
expect
(
page
).
to
have_content
"Password confirmation doesn't match"
end
end
step
'I reset my token'
do
step
'I reset my token'
do
within
'.update-token'
do
page
.
within
'.update-token'
do
@old_token
=
@user
.
private_token
@old_token
=
@user
.
private_token
click_button
"Reset"
click_button
"Reset"
end
end
end
end
step
'I should see new token'
do
step
'I should see new token'
do
find
(
"#token"
).
value
.
should_not
==
@old_token
expect
(
find
(
"#token"
).
value
).
not_to
eq
@old_token
find
(
"#token"
).
value
.
should
==
@user
.
reload
.
private_token
expect
(
find
(
"#token"
).
value
).
to
eq
@user
.
reload
.
private_token
end
end
step
'I have activity'
do
step
'I have activity'
do
...
@@ -111,28 +111,28 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -111,28 +111,28 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
'I should see my activity'
do
step
'I should see my activity'
do
page
.
should
have_content
"
#{
current_user
.
name
}
closed issue"
expect
(
page
).
to
have_content
"
#{
current_user
.
name
}
closed issue"
end
end
step
"I change my application theme"
do
step
"I change my application theme"
do
within
'.application-theme'
do
page
.
within
'.application-theme'
do
choose
"Violet"
choose
"Violet"
end
end
end
end
step
"I change my code preview theme"
do
step
"I change my code preview theme"
do
within
'.code-preview-theme'
do
page
.
within
'.code-preview-theme'
do
choose
"Solarized dark"
choose
"Solarized dark"
end
end
end
end
step
"I should see the theme change immediately"
do
step
"I should see the theme change immediately"
do
page
.
should
have_selector
(
'body.ui_color'
)
expect
(
page
).
to
have_selector
(
'body.ui_color'
)
page
.
should_not
have_selector
(
'body.ui_basic'
)
expect
(
page
).
not_to
have_selector
(
'body.ui_basic'
)
end
end
step
"I should receive feedback that the changes were saved"
do
step
"I should receive feedback that the changes were saved"
do
page
.
should
have_content
(
"saved"
)
expect
(
page
).
to
have_content
(
"saved"
)
end
end
step
'my password is expired'
do
step
'my password is expired'
do
...
@@ -141,11 +141,11 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -141,11 +141,11 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
step
"I am not an ldap user"
do
step
"I am not an ldap user"
do
current_user
.
identities
.
delete
current_user
.
identities
.
delete
current_user
.
ldap_user?
.
should
be_false
expect
(
current_user
.
ldap_user?
).
to
be_false
end
end
step
'I redirected to expired password page'
do
step
'I redirected to expired password page'
do
current_path
.
should
==
new_profile_password_path
expect
(
current_path
).
to
eq
new_profile_password_path
end
end
step
'I submit new password'
do
step
'I submit new password'
do
...
@@ -156,15 +156,15 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -156,15 +156,15 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
'I redirected to sign in page'
do
step
'I redirected to sign in page'
do
current_path
.
should
==
new_user_session_path
expect
(
current_path
).
to
eq
new_user_session_path
end
end
step
'I should be redirected to password page'
do
step
'I should be redirected to password page'
do
current_path
.
should
==
edit_profile_password_path
expect
(
current_path
).
to
eq
edit_profile_password_path
end
end
step
'I should be redirected to account page'
do
step
'I should be redirected to account page'
do
current_path
.
should
==
profile_account_path
expect
(
current_path
).
to
eq
profile_account_path
end
end
step
'I click on my profile picture'
do
step
'I click on my profile picture'
do
...
@@ -172,10 +172,10 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -172,10 +172,10 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
'I should see my user page'
do
step
'I should see my user page'
do
page
.
should
have_content
"User Activity"
expect
(
page
).
to
have_content
"User Activity"
within
'.navbar-gitlab'
do
page
.
within
'.navbar-gitlab'
do
page
.
should
have_content
current_user
.
name
expect
(
page
).
to
have_content
current_user
.
name
end
end
end
end
...
@@ -189,7 +189,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -189,7 +189,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
'I should see groups I belong to'
do
step
'I should see groups I belong to'
do
page
.
should
have_css
(
'.profile-groups-avatars'
,
visible:
true
)
expect
(
page
).
to
have_css
(
'.profile-groups-avatars'
,
visible:
true
)
end
end
step
'I click on new application button'
do
step
'I click on new application button'
do
...
@@ -197,7 +197,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -197,7 +197,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
'I should see application form'
do
step
'I should see application form'
do
page
.
should
have_content
"New application"
expect
(
page
).
to
have_content
"New application"
end
end
step
'I fill application form out and submit'
do
step
'I fill application form out and submit'
do
...
@@ -207,9 +207,9 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -207,9 +207,9 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
'I see application'
do
step
'I see application'
do
page
.
should
have_content
"Application: test"
expect
(
page
).
to
have_content
"Application: test"
page
.
should
have_content
"Application Id"
expect
(
page
).
to
have_content
"Application Id"
page
.
should
have_content
"Secret"
expect
(
page
).
to
have_content
"Secret"
end
end
step
'I click edit'
do
step
'I click edit'
do
...
@@ -217,28 +217,28 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
...
@@ -217,28 +217,28 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
step
'I see edit application form'
do
step
'I see edit application form'
do
page
.
should
have_content
"Edit application"
expect
(
page
).
to
have_content
"Edit application"
end
end
step
'I change name of application and submit'
do
step
'I change name of application and submit'
do
page
.
should
have_content
"Edit application"
expect
(
page
).
to
have_content
"Edit application"
fill_in
:doorkeeper_application_name
,
with:
'test_changed'
fill_in
:doorkeeper_application_name
,
with:
'test_changed'
click_on
"Submit"
click_on
"Submit"
end
end
step
'I see that application was changed'
do
step
'I see that application was changed'
do
page
.
should
have_content
"test_changed"
expect
(
page
).
to
have_content
"test_changed"
page
.
should
have_content
"Application Id"
expect
(
page
).
to
have_content
"Application Id"
page
.
should
have_content
"Secret"
expect
(
page
).
to
have_content
"Secret"
end
end
step
'I click to remove application'
do
step
'I click to remove application'
do
within
'.oauth-applications'
do
page
.
within
'.oauth-applications'
do
click_on
"Destroy"
click_on
"Destroy"
end
end
end
end
step
"I see that application is removed"
do
step
"I see that application is removed"
do
page
.
find
(
".oauth-applications"
).
should_not
have_content
"test_changed"
expect
(
page
.
find
(
".oauth-applications"
)).
not_to
have_content
"test_changed"
end
end
end
end
features/steps/profile/ssh_keys.rb
View file @
8949758f
...
@@ -3,7 +3,7 @@ class Spinach::Features::ProfileSshKeys < Spinach::FeatureSteps
...
@@ -3,7 +3,7 @@ class Spinach::Features::ProfileSshKeys < Spinach::FeatureSteps
step
'I should see my ssh keys'
do
step
'I should see my ssh keys'
do
@user
.
keys
.
each
do
|
key
|
@user
.
keys
.
each
do
|
key
|
page
.
should
have_content
(
key
.
title
)
expect
(
page
).
to
have_content
(
key
.
title
)
end
end
end
end
...
@@ -19,9 +19,9 @@ class Spinach::Features::ProfileSshKeys < Spinach::FeatureSteps
...
@@ -19,9 +19,9 @@ class Spinach::Features::ProfileSshKeys < Spinach::FeatureSteps
step
'I should see new ssh key "Laptop"'
do
step
'I should see new ssh key "Laptop"'
do
key
=
Key
.
find_by
(
title:
"Laptop"
)
key
=
Key
.
find_by
(
title:
"Laptop"
)
page
.
should
have_content
(
key
.
title
)
expect
(
page
).
to
have_content
(
key
.
title
)
page
.
should
have_content
(
key
.
key
)
expect
(
page
).
to
have_content
(
key
.
key
)
current_path
.
should
==
profile_key_path
(
key
)
expect
(
current_path
).
to
eq
profile_key_path
(
key
)
end
end
step
'I click link "Work"'
do
step
'I click link "Work"'
do
...
@@ -37,7 +37,7 @@ class Spinach::Features::ProfileSshKeys < Spinach::FeatureSteps
...
@@ -37,7 +37,7 @@ class Spinach::Features::ProfileSshKeys < Spinach::FeatureSteps
end
end
step
'I should not see "Work" ssh key'
do
step
'I should not see "Work" ssh key'
do
page
.
should_not
have_content
"Work"
expect
(
page
).
not_to
have_content
"Work"
end
end
step
'I have ssh key "ssh-rsa Work"'
do
step
'I have ssh key "ssh-rsa Work"'
do
...
...
features/steps/project/active_tab.rb
View file @
8949758f
...
@@ -20,7 +20,7 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
...
@@ -20,7 +20,7 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
end
end
step
'I click the "Edit" tab'
do
step
'I click the "Edit" tab'
do
within
'.project-settings-nav'
do
page
.
within
'.project-settings-nav'
do
click_link
(
'Project'
)
click_link
(
'Project'
)
end
end
end
end
...
...
features/steps/project/archived.rb
View file @
8949758f
...
@@ -19,11 +19,11 @@ class Spinach::Features::ProjectArchived < Spinach::FeatureSteps
...
@@ -19,11 +19,11 @@ class Spinach::Features::ProjectArchived < Spinach::FeatureSteps
end
end
step
'I should not see "Archived"'
do
step
'I should not see "Archived"'
do
page
.
should_not
have_content
"Archived"
expect
(
page
).
not_to
have_content
"Archived"
end
end
step
'I should see "Archived"'
do
step
'I should see "Archived"'
do
page
.
should
have_content
"Archived"
expect
(
page
).
to
have_content
"Archived"
end
end
When
'I set project archived'
do
When
'I set project archived'
do
...
...
features/steps/project/commits/branches.rb
View file @
8949758f
...
@@ -8,8 +8,8 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps
...
@@ -8,8 +8,8 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps
end
end
step
'I should see "Shop" all branches list'
do
step
'I should see "Shop" all branches list'
do
page
.
should
have_content
"Branches"
expect
(
page
).
to
have_content
"Branches"
page
.
should
have_content
"master"
expect
(
page
).
to
have_content
"master"
end
end
step
'I click link "Protected"'
do
step
'I click link "Protected"'
do
...
@@ -17,9 +17,9 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps
...
@@ -17,9 +17,9 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps
end
end
step
'I should see "Shop" protected branches list'
do
step
'I should see "Shop" protected branches list'
do
within
".protected-branches-list"
do
page
.
within
".protected-branches-list"
do
page
.
should
have_content
"stable"
expect
(
page
).
to
have_content
"stable"
page
.
should_not
have_content
"master"
expect
(
page
).
not_to
have_content
"master"
end
end
end
end
...
@@ -57,29 +57,29 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps
...
@@ -57,29 +57,29 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps
end
end
step
'I should see new branch created'
do
step
'I should see new branch created'
do
page
.
should
have_content
'deploy_keys'
expect
(
page
).
to
have_content
'deploy_keys'
end
end
step
'I should see new an error that branch is invalid'
do
step
'I should see new an error that branch is invalid'
do
page
.
should
have_content
'Branch name invalid'
expect
(
page
).
to
have_content
'Branch name invalid'
end
end
step
'I should see new an error that ref is invalid'
do
step
'I should see new an error that ref is invalid'
do
page
.
should
have_content
'Invalid reference name'
expect
(
page
).
to
have_content
'Invalid reference name'
end
end
step
'I should see new an error that branch already exists'
do
step
'I should see new an error that branch already exists'
do
page
.
should
have_content
'Branch already exists'
expect
(
page
).
to
have_content
'Branch already exists'
end
end
step
"I click branch 'improve/awesome' delete link"
do
step
"I click branch 'improve/awesome' delete link"
do
within
'.js-branch-improve\/awesome'
do
page
.
within
'.js-branch-improve\/awesome'
do
find
(
'.btn-remove'
).
click
find
(
'.btn-remove'
).
click
sleep
0.05
sleep
0.05
end
end
end
end
step
"I should not see branch 'improve/awesome'"
do
step
"I should not see branch 'improve/awesome'"
do
all
(
visible:
true
).
should_not
have_content
'improve/awesome'
expect
(
page
.
all
(
visible:
true
)).
not_to
have_content
'improve/awesome'
end
end
end
end
features/steps/project/commits/commits.rb
View file @
8949758f
...
@@ -6,9 +6,9 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
...
@@ -6,9 +6,9 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
step
'I see project commits'
do
step
'I see project commits'
do
commit
=
@project
.
repository
.
commit
commit
=
@project
.
repository
.
commit
page
.
should
have_content
(
@project
.
name
)
expect
(
page
).
to
have_content
(
@project
.
name
)
page
.
should
have_content
(
commit
.
message
[
0
..
20
])
expect
(
page
).
to
have_content
(
commit
.
message
[
0
..
20
])
page
.
should
have_content
(
commit
.
short_id
)
expect
(
page
).
to
have_content
(
commit
.
short_id
)
end
end
step
'I click atom feed link'
do
step
'I click atom feed link'
do
...
@@ -17,10 +17,10 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
...
@@ -17,10 +17,10 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
step
'I see commits atom feed'
do
step
'I see commits atom feed'
do
commit
=
@project
.
repository
.
commit
commit
=
@project
.
repository
.
commit
response_headers
[
'Content-Type'
].
should
have_content
(
"application/atom+xml"
)
expect
(
response_headers
[
'Content-Type'
]).
to
have_content
(
"application/atom+xml"
)
body
.
should
have_selector
(
"title"
,
text:
"
#{
@project
.
name
}
:master commits"
)
expect
(
body
).
to
have_selector
(
"title"
,
text:
"
#{
@project
.
name
}
:master commits"
)
body
.
should
have_selector
(
"author email"
,
text:
commit
.
author_email
)
expect
(
body
).
to
have_selector
(
"author email"
,
text:
commit
.
author_email
)
body
.
should
have_selector
(
"entry summary"
,
text:
commit
.
description
[
0
..
10
])
expect
(
body
).
to
have_selector
(
"entry summary"
,
text:
commit
.
description
[
0
..
10
])
end
end
step
'I click on commit link'
do
step
'I click on commit link'
do
...
@@ -28,8 +28,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
...
@@ -28,8 +28,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end
end
step
'I see commit info'
do
step
'I see commit info'
do
page
.
should
have_content
sample_commit
.
message
expect
(
page
).
to
have_content
sample_commit
.
message
page
.
should
have_content
"Showing
#{
sample_commit
.
files_changed_count
}
changed files"
expect
(
page
).
to
have_content
"Showing
#{
sample_commit
.
files_changed_count
}
changed files"
end
end
step
'I fill compare fields with refs'
do
step
'I fill compare fields with refs'
do
...
@@ -45,27 +45,27 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
...
@@ -45,27 +45,27 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end
end
step
'I should see additional file lines'
do
step
'I should see additional file lines'
do
within
@diff
.
parent
do
page
.
within
@diff
.
parent
do
first
(
'.new_line'
).
text
.
should_not
have_content
"..."
expect
(
first
(
'.new_line'
).
text
).
not_to
have_content
"..."
end
end
end
end
step
'I see compared refs'
do
step
'I see compared refs'
do
page
.
should
have_content
"Compare View"
expect
(
page
).
to
have_content
"Compare View"
page
.
should
have_content
"Commits (1)"
expect
(
page
).
to
have_content
"Commits (1)"
page
.
should
have_content
"Showing 2 changed files"
expect
(
page
).
to
have_content
"Showing 2 changed files"
end
end
step
'I see breadcrumb links'
do
step
'I see breadcrumb links'
do
page
.
should
have_selector
(
'ul.breadcrumb'
)
expect
(
page
).
to
have_selector
(
'ul.breadcrumb'
)
page
.
should
have_selector
(
'ul.breadcrumb a'
,
count:
4
)
expect
(
page
).
to
have_selector
(
'ul.breadcrumb a'
,
count:
4
)
end
end
step
'I see commits stats'
do
step
'I see commits stats'
do
page
.
should
have_content
'Top 50 Committers'
expect
(
page
).
to
have_content
'Top 50 Committers'
page
.
should
have_content
'Committers'
expect
(
page
).
to
have_content
'Committers'
page
.
should
have_content
'Total commits'
expect
(
page
).
to
have_content
'Total commits'
page
.
should
have_content
'Authors'
expect
(
page
).
to
have_content
'Authors'
end
end
step
'I visit big commit page'
do
step
'I visit big commit page'
do
...
@@ -74,8 +74,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
...
@@ -74,8 +74,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end
end
step
'I see big commit warning'
do
step
'I see big commit warning'
do
page
.
should
have_content
sample_big_commit
.
message
expect
(
page
).
to
have_content
sample_big_commit
.
message
page
.
should
have_content
"Too many changes"
expect
(
page
).
to
have_content
"Too many changes"
end
end
step
'I visit a commit with an image that changed'
do
step
'I visit a commit with an image that changed'
do
...
@@ -83,9 +83,9 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
...
@@ -83,9 +83,9 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end
end
step
'The diff links to both the previous and current image'
do
step
'The diff links to both the previous and current image'
do
links
=
all
(
'.two-up span div a'
)
links
=
page
.
all
(
'.two-up span div a'
)
links
[
0
][
'href'
].
should
=~
%r{blob/
#{
sample_image_commit
.
old_blob_id
}
}
expect
(
links
[
0
][
'href'
]).
to
match
%r{blob/
#{
sample_image_commit
.
old_blob_id
}
}
links
[
1
][
'href'
].
should
=~
%r{blob/
#{
sample_image_commit
.
new_blob_id
}
}
expect
(
links
[
1
][
'href'
]).
to
match
%r{blob/
#{
sample_image_commit
.
new_blob_id
}
}
end
end
step
'I click side-by-side diff button'
do
step
'I click side-by-side diff button'
do
...
@@ -93,10 +93,10 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
...
@@ -93,10 +93,10 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end
end
step
'I see side-by-side diff button'
do
step
'I see side-by-side diff button'
do
page
.
should
have_content
"Side-by-side"
expect
(
page
).
to
have_content
"Side-by-side"
end
end
step
'I see inline diff button'
do
step
'I see inline diff button'
do
page
.
should
have_content
"Inline"
expect
(
page
).
to
have_content
"Inline"
end
end
end
end
features/steps/project/commits/tags.rb
View file @
8949758f
...
@@ -4,8 +4,8 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps
...
@@ -4,8 +4,8 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps
include
SharedPaths
include
SharedPaths
step
'I should see "Shop" all tags list'
do
step
'I should see "Shop" all tags list'
do
page
.
should
have_content
"Tags"
expect
(
page
).
to
have_content
"Tags"
page
.
should
have_content
"v1.0.0"
expect
(
page
).
to
have_content
"v1.0.0"
end
end
step
'I click new tag link'
do
step
'I click new tag link'
do
...
@@ -37,37 +37,37 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps
...
@@ -37,37 +37,37 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps
end
end
step
'I should see new tag created'
do
step
'I should see new tag created'
do
page
.
should
have_content
'v7.0'
expect
(
page
).
to
have_content
'v7.0'
end
end
step
'I should see new an error that tag is invalid'
do
step
'I should see new an error that tag is invalid'
do
page
.
should
have_content
'Tag name invalid'
expect
(
page
).
to
have_content
'Tag name invalid'
end
end
step
'I should see new an error that tag ref is invalid'
do
step
'I should see new an error that tag ref is invalid'
do
page
.
should
have_content
'Invalid reference name'
expect
(
page
).
to
have_content
'Invalid reference name'
end
end
step
'I should see new an error that tag already exists'
do
step
'I should see new an error that tag already exists'
do
page
.
should
have_content
'Tag already exists'
expect
(
page
).
to
have_content
'Tag already exists'
end
end
step
"I delete tag 'v1.1.0'"
do
step
"I delete tag 'v1.1.0'"
do
within
'.tags'
do
page
.
within
'.tags'
do
first
(
'.btn-remove'
).
click
first
(
'.btn-remove'
).
click
sleep
0.05
sleep
0.05
end
end
end
end
step
"I should not see tag 'v1.1.0'"
do
step
"I should not see tag 'v1.1.0'"
do
within
'.tags'
do
page
.
within
'.tags'
do
all
(
visible:
true
).
should_not
have_content
'v1.1.0'
expect
(
page
.
all
(
visible:
true
)).
not_to
have_content
'v1.1.0'
end
end
end
end
step
'I delete all tags'
do
step
'I delete all tags'
do
within
'.tags'
do
page
.
within
'.tags'
do
all
(
'.btn-remove'
).
each
do
|
remove
|
page
.
all
(
'.btn-remove'
).
each
do
|
remove
|
remove
.
click
remove
.
click
sleep
0.05
sleep
0.05
end
end
...
@@ -75,8 +75,8 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps
...
@@ -75,8 +75,8 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps
end
end
step
'I should see tags info message'
do
step
'I should see tags info message'
do
within
'.tags'
do
page
.
within
'.tags'
do
page
.
should
have_content
'Repository has no tags yet.'
expect
(
page
).
to
have_content
'Repository has no tags yet.'
end
end
end
end
end
end
features/steps/project/commits/user_lookup.rb
View file @
8949758f
...
@@ -29,9 +29,9 @@ class Spinach::Features::ProjectCommitsUserLookup < Spinach::FeatureSteps
...
@@ -29,9 +29,9 @@ class Spinach::Features::ProjectCommitsUserLookup < Spinach::FeatureSteps
def
check_author_link
(
email
,
user
)
def
check_author_link
(
email
,
user
)
author_link
=
find
(
'.commit-author-link'
)
author_link
=
find
(
'.commit-author-link'
)
author_link
[
'href'
].
should
==
user_path
(
user
)
expect
(
author_link
[
'href'
]).
to
eq
user_path
(
user
)
author_link
[
'data-original-title'
].
should
==
email
expect
(
author_link
[
'data-original-title'
]).
to
eq
email
find
(
'.commit-author-name'
).
text
.
should
==
user
.
name
expect
(
find
(
'.commit-author-name'
).
text
).
to
eq
user
.
name
end
end
def
user_primary
def
user_primary
...
...
features/steps/project/create.rb
View file @
8949758f
...
@@ -8,20 +8,20 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps
...
@@ -8,20 +8,20 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps
end
end
step
'I should see project page'
do
step
'I should see project page'
do
page
.
should
have_content
"Empty"
expect
(
page
).
to
have_content
"Empty"
current_path
.
should
==
namespace_project_path
(
Project
.
last
.
namespace
,
Project
.
last
)
expect
(
current_path
).
to
eq
namespace_project_path
(
Project
.
last
.
namespace
,
Project
.
last
)
end
end
step
'I should see empty project instuctions'
do
step
'I should see empty project instuctions'
do
page
.
should
have_content
"git init"
expect
(
page
).
to
have_content
"git init"
page
.
should
have_content
"git remote"
expect
(
page
).
to
have_content
"git remote"
page
.
should
have_content
Project
.
last
.
url_to_repo
expect
(
page
).
to
have_content
Project
.
last
.
url_to_repo
end
end
step
'I see empty project instuctions'
do
step
'I see empty project instuctions'
do
page
.
should
have_content
"git init"
expect
(
page
).
to
have_content
"git init"
page
.
should
have_content
"git remote"
expect
(
page
).
to
have_content
"git remote"
page
.
should
have_content
Project
.
last
.
url_to_repo
expect
(
page
).
to
have_content
Project
.
last
.
url_to_repo
end
end
step
'I click on HTTP'
do
step
'I click on HTTP'
do
...
@@ -29,7 +29,7 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps
...
@@ -29,7 +29,7 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps
end
end
step
'Remote url should update to http link'
do
step
'Remote url should update to http link'
do
page
.
should
have_content
"git remote add origin
#{
Project
.
last
.
http_url_to_repo
}
"
expect
(
page
).
to
have_content
"git remote add origin
#{
Project
.
last
.
http_url_to_repo
}
"
end
end
step
'If I click on SSH'
do
step
'If I click on SSH'
do
...
@@ -37,6 +37,6 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps
...
@@ -37,6 +37,6 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps
end
end
step
'Remote url should update to ssh link'
do
step
'Remote url should update to ssh link'
do
page
.
should
have_content
"git remote add origin
#{
Project
.
last
.
url_to_repo
}
"
expect
(
page
).
to
have_content
"git remote add origin
#{
Project
.
last
.
url_to_repo
}
"
end
end
end
end
features/steps/project/deploy_keys.rb
View file @
8949758f
...
@@ -8,20 +8,20 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
...
@@ -8,20 +8,20 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
end
step
'I should see project deploy key'
do
step
'I should see project deploy key'
do
within
'.enabled-keys'
do
page
.
within
'.enabled-keys'
do
page
.
should
have_content
deploy_key
.
title
expect
(
page
).
to
have_content
deploy_key
.
title
end
end
end
end
step
'I should see other project deploy key'
do
step
'I should see other project deploy key'
do
within
'.available-keys'
do
page
.
within
'.available-keys'
do
page
.
should
have_content
other_deploy_key
.
title
expect
(
page
).
to
have_content
other_deploy_key
.
title
end
end
end
end
step
'I should see public deploy key'
do
step
'I should see public deploy key'
do
within
'.available-keys'
do
page
.
within
'.available-keys'
do
page
.
should
have_content
public_deploy_key
.
title
expect
(
page
).
to
have_content
public_deploy_key
.
title
end
end
end
end
...
@@ -36,12 +36,12 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
...
@@ -36,12 +36,12 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
end
step
'I should be on deploy keys page'
do
step
'I should be on deploy keys page'
do
current_path
.
should
==
namespace_project_deploy_keys_path
(
@project
.
namespace
,
@project
)
expect
(
current_path
).
to
eq
namespace_project_deploy_keys_path
(
@project
.
namespace
,
@project
)
end
end
step
'I should see newly created deploy key'
do
step
'I should see newly created deploy key'
do
within
'.enabled-keys'
do
page
.
within
'.enabled-keys'
do
page
.
should
have_content
(
deploy_key
.
title
)
expect
(
page
).
to
have_content
(
deploy_key
.
title
)
end
end
end
end
...
@@ -56,8 +56,8 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
...
@@ -56,8 +56,8 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
end
step
'I should only see the same deploy key once'
do
step
'I should only see the same deploy key once'
do
within
'.available-keys'
do
page
.
within
'.available-keys'
do
page
.
should
have_selector
(
'ul li'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'ul li'
,
count:
1
)
end
end
end
end
...
@@ -66,7 +66,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
...
@@ -66,7 +66,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
end
end
step
'I click attach deploy key'
do
step
'I click attach deploy key'
do
within
'.available-keys'
do
page
.
within
'.available-keys'
do
click_link
'Enable'
click_link
'Enable'
end
end
end
end
...
...
features/steps/project/fork.rb
View file @
8949758f
...
@@ -4,8 +4,8 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
...
@@ -4,8 +4,8 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
include
SharedProject
include
SharedProject
step
'I click link "Fork"'
do
step
'I click link "Fork"'
do
page
.
should
have_content
"Shop"
expect
(
page
).
to
have_content
"Shop"
page
.
should
have_content
"Fork"
expect
(
page
).
to
have_content
"Fork"
click_link
"Fork"
click_link
"Fork"
end
end
...
@@ -15,7 +15,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
...
@@ -15,7 +15,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
end
end
step
'I should see the forked project page'
do
step
'I should see the forked project page'
do
page
.
should
have_content
"Project was successfully forked."
expect
(
page
).
to
have_content
"Project was successfully forked."
end
end
step
'I already have a project named "Shop" in my namespace'
do
step
'I already have a project named "Shop" in my namespace'
do
...
@@ -23,11 +23,11 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
...
@@ -23,11 +23,11 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
end
end
step
'I should see a "Name has already been taken" warning'
do
step
'I should see a "Name has already been taken" warning'
do
page
.
should
have_content
"Name has already been taken"
expect
(
page
).
to
have_content
"Name has already been taken"
end
end
step
'I fork to my namespace'
do
step
'I fork to my namespace'
do
within
'.fork-namespaces'
do
page
.
within
'.fork-namespaces'
do
click_link
current_user
.
name
click_link
current_user
.
name
end
end
end
end
...
...
features/steps/project/forked_merge_requests.rb
View file @
8949758f
...
@@ -21,17 +21,17 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
...
@@ -21,17 +21,17 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see merge request "Merge Request On Forked Project"'
do
step
'I should see merge request "Merge Request On Forked Project"'
do
@project
.
merge_requests
.
size
.
should
>=
1
expect
(
@project
.
merge_requests
.
size
).
to
be
>=
1
@merge_request
=
@project
.
merge_requests
.
last
@merge_request
=
@project
.
merge_requests
.
last
current_path
.
should
==
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
expect
(
current_path
).
to
eq
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
@merge_request
.
title
.
should
==
"Merge Request On Forked Project"
expect
(
@merge_request
.
title
).
to
eq
"Merge Request On Forked Project"
@merge_request
.
source_project
.
should
==
@forked_project
expect
(
@merge_request
.
source_project
).
to
eq
@forked_project
@merge_request
.
source_branch
.
should
==
"fix"
expect
(
@merge_request
.
source_branch
).
to
eq
"fix"
@merge_request
.
target_branch
.
should
==
"master"
expect
(
@merge_request
.
target_branch
).
to
eq
"master"
page
.
should
have_content
@forked_project
.
path_with_namespace
expect
(
page
).
to
have_content
@forked_project
.
path_with_namespace
page
.
should
have_content
@project
.
path_with_namespace
expect
(
page
).
to
have_content
@project
.
path_with_namespace
page
.
should
have_content
@merge_request
.
source_branch
expect
(
page
).
to
have_content
@merge_request
.
source_branch
page
.
should
have_content
@merge_request
.
target_branch
expect
(
page
).
to
have_content
@merge_request
.
target_branch
end
end
step
'I fill out a "Merge Request On Forked Project" merge request'
do
step
'I fill out a "Merge Request On Forked Project" merge request'
do
...
@@ -56,7 +56,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
...
@@ -56,7 +56,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
step
'I should see the commit under the forked from project'
do
step
'I should see the commit under the forked from project'
do
commit
=
@project
.
repository
.
commit
commit
=
@project
.
repository
.
commit
page
.
should
have_content
(
commit
.
message
)
expect
(
page
).
to
have_content
(
commit
.
message
)
end
end
step
'I click "Create Merge Request on fork" link'
do
step
'I click "Create Merge Request on fork" link'
do
...
@@ -64,12 +64,12 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
...
@@ -64,12 +64,12 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
end
end
step
'I see prefilled new Merge Request page for the forked project'
do
step
'I see prefilled new Merge Request page for the forked project'
do
current_path
.
should
==
new_namespace_project_merge_request_path
(
@forked_project
.
namespace
,
@forked_project
)
expect
(
current_path
).
to
eq
new_namespace_project_merge_request_path
(
@forked_project
.
namespace
,
@forked_project
)
find
(
"#merge_request_source_project_id"
).
value
.
should
==
@forked_project
.
id
.
to_s
expect
(
find
(
"#merge_request_source_project_id"
).
value
).
to
eq
@forked_project
.
id
.
to_s
find
(
"#merge_request_target_project_id"
).
value
.
should
==
@project
.
id
.
to_s
expect
(
find
(
"#merge_request_target_project_id"
).
value
).
to
eq
@project
.
id
.
to_s
find
(
"#merge_request_source_branch"
).
value
.
should
have_content
"new_design"
expect
(
find
(
"#merge_request_source_branch"
).
value
).
to
have_content
"new_design"
find
(
"#merge_request_target_branch"
).
value
.
should
have_content
"master"
expect
(
find
(
"#merge_request_target_branch"
).
value
).
to
have_content
"master"
find
(
"#merge_request_title"
).
value
.
should
==
"New Design"
expect
(
find
(
"#merge_request_title"
).
value
).
to
eq
"New Design"
verify_commit_link
(
".mr_target_commit"
,
@project
)
verify_commit_link
(
".mr_target_commit"
,
@project
)
verify_commit_link
(
".mr_source_commit"
,
@forked_project
)
verify_commit_link
(
".mr_source_commit"
,
@forked_project
)
end
end
...
@@ -83,22 +83,22 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
...
@@ -83,22 +83,22 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see the edited merge request'
do
step
'I should see the edited merge request'
do
page
.
should
have_content
"An Edited Forked Merge Request"
expect
(
page
).
to
have_content
"An Edited Forked Merge Request"
@project
.
merge_requests
.
size
.
should
>=
1
expect
(
@project
.
merge_requests
.
size
).
to
be
>=
1
@merge_request
=
@project
.
merge_requests
.
last
@merge_request
=
@project
.
merge_requests
.
last
current_path
.
should
==
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
expect
(
current_path
).
to
eq
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
@merge_request
.
source_project
.
should
==
@forked_project
expect
(
@merge_request
.
source_project
).
to
eq
@forked_project
@merge_request
.
source_branch
.
should
==
"fix"
expect
(
@merge_request
.
source_branch
).
to
eq
"fix"
@merge_request
.
target_branch
.
should
==
"master"
expect
(
@merge_request
.
target_branch
).
to
eq
"master"
page
.
should
have_content
@forked_project
.
path_with_namespace
expect
(
page
).
to
have_content
@forked_project
.
path_with_namespace
page
.
should
have_content
@project
.
path_with_namespace
expect
(
page
).
to
have_content
@project
.
path_with_namespace
page
.
should
have_content
@merge_request
.
source_branch
expect
(
page
).
to
have_content
@merge_request
.
source_branch
page
.
should
have_content
@merge_request
.
target_branch
expect
(
page
).
to
have_content
@merge_request
.
target_branch
end
end
step
'I should see last push widget'
do
step
'I should see last push widget'
do
page
.
should
have_content
"You pushed to new_design"
expect
(
page
).
to
have_content
"You pushed to new_design"
page
.
should
have_link
"Create Merge Request"
expect
(
page
).
to
have_link
"Create Merge Request"
end
end
step
'I click link edit "Merge Request On Forked Project"'
do
step
'I click link edit "Merge Request On Forked Project"'
do
...
@@ -106,26 +106,26 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
...
@@ -106,26 +106,26 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
end
end
step
'I see the edit page prefilled for "Merge Request On Forked Project"'
do
step
'I see the edit page prefilled for "Merge Request On Forked Project"'
do
current_path
.
should
==
edit_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
expect
(
current_path
).
to
eq
edit_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
page
.
should
have_content
"Edit merge request #
#{
@merge_request
.
id
}
"
expect
(
page
).
to
have_content
"Edit merge request #
#{
@merge_request
.
id
}
"
find
(
"#merge_request_title"
).
value
.
should
==
"Merge Request On Forked Project"
expect
(
find
(
"#merge_request_title"
).
value
).
to
eq
"Merge Request On Forked Project"
end
end
step
'I fill out an invalid "Merge Request On Forked Project" merge request'
do
step
'I fill out an invalid "Merge Request On Forked Project" merge request'
do
select
"Select branch"
,
from:
"merge_request_target_branch"
select
"Select branch"
,
from:
"merge_request_target_branch"
find
(
:select
,
"merge_request_source_project_id"
,
{}).
value
.
should
==
@forked_project
.
id
.
to_s
expect
(
find
(
:select
,
"merge_request_source_project_id"
,
{}).
value
).
to
eq
@forked_project
.
id
.
to_s
find
(
:select
,
"merge_request_target_project_id"
,
{}).
value
.
should
==
@project
.
id
.
to_s
expect
(
find
(
:select
,
"merge_request_target_project_id"
,
{}).
value
).
to
eq
@project
.
id
.
to_s
find
(
:select
,
"merge_request_source_branch"
,
{}).
value
.
should
==
""
expect
(
find
(
:select
,
"merge_request_source_branch"
,
{}).
value
).
to
eq
""
find
(
:select
,
"merge_request_target_branch"
,
{}).
value
.
should
==
""
expect
(
find
(
:select
,
"merge_request_target_branch"
,
{}).
value
).
to
eq
""
click_button
"Compare branches"
click_button
"Compare branches"
end
end
step
'I should see validation errors'
do
step
'I should see validation errors'
do
page
.
should
have_content
"You must select source and target branch"
expect
(
page
).
to
have_content
"You must select source and target branch"
end
end
step
'the target repository should be the original repository'
do
step
'the target repository should be the original repository'
do
page
.
should
have_select
(
"merge_request_target_project_id"
,
selected:
@project
.
path_with_namespace
)
expect
(
page
).
to
have_select
(
"merge_request_target_project_id"
,
selected:
@project
.
path_with_namespace
)
end
end
step
'I click "Assign to" dropdown"'
do
step
'I click "Assign to" dropdown"'
do
...
@@ -139,13 +139,13 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
...
@@ -139,13 +139,13 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
step
'I should see the users from the target project ID'
do
step
'I should see the users from the target project ID'
do
expect
(
page
).
to
have_selector
(
'.user-result'
,
visible:
true
,
count:
2
)
expect
(
page
).
to
have_selector
(
'.user-result'
,
visible:
true
,
count:
2
)
users
=
page
.
all
(
'.user-name'
)
users
=
page
.
all
(
'.user-name'
)
users
[
0
].
text
.
should
==
'Unassigned'
expect
(
users
[
0
].
text
).
to
eq
'Unassigned'
users
[
1
].
text
.
should
==
@project
.
users
.
first
.
name
expect
(
users
[
1
].
text
).
to
eq
@project
.
users
.
first
.
name
end
end
# Verify a link is generated against the correct project
# Verify a link is generated against the correct project
def
verify_commit_link
(
container_div
,
container_project
)
def
verify_commit_link
(
container_div
,
container_project
)
# This should force a wait for the javascript to execute
# This should force a wait for the javascript to execute
find
(
:div
,
container_div
).
find
(
".commit_short_id"
)[
'href'
].
should
have_content
"
#{
container_project
.
path_with_namespace
}
/commit"
expect
(
find
(
:div
,
container_div
).
find
(
".commit_short_id"
)[
'href'
]).
to
have_content
"
#{
container_project
.
path_with_namespace
}
/commit"
end
end
end
end
features/steps/project/graph.rb
View file @
8949758f
...
@@ -3,7 +3,7 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
...
@@ -3,7 +3,7 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
include
SharedProject
include
SharedProject
step
'page should have graphs'
do
step
'page should have graphs'
do
page
.
should
have_selector
".stat-graph"
expect
(
page
).
to
have_selector
".stat-graph"
end
end
When
'I visit project "Shop" graph page'
do
When
'I visit project "Shop" graph page'
do
...
@@ -17,7 +17,7 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
...
@@ -17,7 +17,7 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
end
end
step
'page should have commits graphs'
do
step
'page should have commits graphs'
do
page
.
should
have_content
"Commit statistics for master"
expect
(
page
).
to
have_content
"Commit statistics for master"
page
.
should
have_content
"Commits per day of month"
expect
(
page
).
to
have_content
"Commits per day of month"
end
end
end
end
features/steps/project/hooks.rb
View file @
8949758f
...
@@ -19,7 +19,7 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
...
@@ -19,7 +19,7 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
end
end
step
'I should see project hook'
do
step
'I should see project hook'
do
page
.
should
have_content
@hook
.
url
expect
(
page
).
to
have_content
@hook
.
url
end
end
step
'I submit new hook'
do
step
'I submit new hook'
do
...
@@ -29,8 +29,8 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
...
@@ -29,8 +29,8 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
end
end
step
'I should see newly created hook'
do
step
'I should see newly created hook'
do
current_path
.
should
==
namespace_project_hooks_path
(
current_project
.
namespace
,
current_project
)
expect
(
current_path
).
to
eq
namespace_project_hooks_path
(
current_project
.
namespace
,
current_project
)
page
.
should
have_content
(
@url
)
expect
(
page
).
to
have_content
(
@url
)
end
end
step
'I click test hook button'
do
step
'I click test hook button'
do
...
@@ -44,19 +44,19 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
...
@@ -44,19 +44,19 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
end
end
step
'hook should be triggered'
do
step
'hook should be triggered'
do
current_path
.
should
==
namespace_project_hooks_path
(
current_project
.
namespace
,
current_project
)
expect
(
current_path
).
to
eq
namespace_project_hooks_path
(
current_project
.
namespace
,
current_project
)
page
.
should
have_selector
'.flash-notice'
,
expect
(
page
).
to
have_selector
'.flash-notice'
,
text:
'Hook successfully executed.'
text:
'Hook successfully executed.'
end
end
step
'I should see hook error message'
do
step
'I should see hook error message'
do
page
.
should
have_selector
'.flash-alert'
,
expect
(
page
).
to
have_selector
'.flash-alert'
,
text:
'Hook execution failed. '
\
text:
'Hook execution failed. '
\
'Ensure the project has commits.'
'Ensure the project has commits.'
end
end
step
'I should see hook service down error message'
do
step
'I should see hook service down error message'
do
page
.
should
have_selector
'.flash-alert'
,
expect
(
page
).
to
have_selector
'.flash-alert'
,
text:
'Hook execution failed. '
\
text:
'Hook execution failed. '
\
'Ensure hook URL is correct and '
\
'Ensure hook URL is correct and '
\
'service is up.'
'service is up.'
...
...
features/steps/project/issues/filter_labels.rb
View file @
8949758f
...
@@ -5,26 +5,26 @@ class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps
...
@@ -5,26 +5,26 @@ class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps
include
Select2Helper
include
Select2Helper
step
'I should see "Bugfix1" in issues list'
do
step
'I should see "Bugfix1" in issues list'
do
within
".issues-list"
do
page
.
within
".issues-list"
do
page
.
should
have_content
"Bugfix1"
expect
(
page
).
to
have_content
"Bugfix1"
end
end
end
end
step
'I should see "Bugfix2" in issues list'
do
step
'I should see "Bugfix2" in issues list'
do
within
".issues-list"
do
page
.
within
".issues-list"
do
page
.
should
have_content
"Bugfix2"
expect
(
page
).
to
have_content
"Bugfix2"
end
end
end
end
step
'I should not see "Bugfix2" in issues list'
do
step
'I should not see "Bugfix2" in issues list'
do
within
".issues-list"
do
page
.
within
".issues-list"
do
page
.
should_not
have_content
"Bugfix2"
expect
(
page
).
not_to
have_content
"Bugfix2"
end
end
end
end
step
'I should not see "Feature1" in issues list'
do
step
'I should not see "Feature1" in issues list'
do
within
".issues-list"
do
page
.
within
".issues-list"
do
page
.
should_not
have_content
"Feature1"
expect
(
page
).
not_to
have_content
"Feature1"
end
end
end
end
...
@@ -33,7 +33,7 @@ class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps
...
@@ -33,7 +33,7 @@ class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps
end
end
step
'I click link "feature"'
do
step
'I click link "feature"'
do
within
".labels-filter"
do
page
.
within
".labels-filter"
do
click_link
"feature"
click_link
"feature"
end
end
end
end
...
...
features/steps/project/issues/issues.rb
View file @
8949758f
...
@@ -7,24 +7,24 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -7,24 +7,24 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
include
SharedMarkdown
include
SharedMarkdown
step
'I should see "Release 0.4" in issues'
do
step
'I should see "Release 0.4" in issues'
do
page
.
should
have_content
"Release 0.4"
expect
(
page
).
to
have_content
"Release 0.4"
end
end
step
'I should not see "Release 0.3" in issues'
do
step
'I should not see "Release 0.3" in issues'
do
page
.
should_not
have_content
"Release 0.3"
expect
(
page
).
not_to
have_content
"Release 0.3"
end
end
step
'I should not see "Tweet control" in issues'
do
step
'I should not see "Tweet control" in issues'
do
page
.
should_not
have_content
"Tweet control"
expect
(
page
).
not_to
have_content
"Tweet control"
end
end
step
'I should see that I am subscribed'
do
step
'I should see that I am subscribed'
do
find
(
".subscribe-button span"
).
text
.
should
==
"Unsubscribe"
expect
(
find
(
".subscribe-button span"
).
text
).
to
eq
"Unsubscribe"
end
end
step
'I should see that I am unsubscribed'
do
step
'I should see that I am unsubscribed'
do
sleep
0.2
sleep
0.2
find
(
".subscribe-button span"
).
text
.
should
==
"Subscribe"
expect
(
find
(
".subscribe-button span"
).
text
).
to
eq
"Subscribe"
end
end
step
'I click link "Closed"'
do
step
'I click link "Closed"'
do
...
@@ -36,11 +36,11 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -36,11 +36,11 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
end
step
'I should see "Release 0.3" in issues'
do
step
'I should see "Release 0.3" in issues'
do
page
.
should
have_content
"Release 0.3"
expect
(
page
).
to
have_content
"Release 0.3"
end
end
step
'I should not see "Release 0.4" in issues'
do
step
'I should not see "Release 0.4" in issues'
do
page
.
should_not
have_content
"Release 0.4"
expect
(
page
).
not_to
have_content
"Release 0.4"
end
end
step
'I click link "All"'
do
step
'I click link "All"'
do
...
@@ -52,7 +52,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -52,7 +52,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
end
step
'I should see issue "Release 0.4"'
do
step
'I should see issue "Release 0.4"'
do
page
.
should
have_content
"Release 0.4"
expect
(
page
).
to
have_content
"Release 0.4"
end
end
step
'I click link "New Issue"'
do
step
'I click link "New Issue"'
do
...
@@ -66,9 +66,9 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -66,9 +66,9 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
step
'I see current user as the first user'
do
step
'I see current user as the first user'
do
expect
(
page
).
to
have_selector
(
'.user-result'
,
visible:
true
,
count:
4
)
expect
(
page
).
to
have_selector
(
'.user-result'
,
visible:
true
,
count:
4
)
users
=
page
.
all
(
'.user-name'
)
users
=
page
.
all
(
'.user-name'
)
users
[
0
].
text
.
should
==
'Any'
expect
(
users
[
0
].
text
).
to
eq
'Any'
users
[
1
].
text
.
should
==
'Unassigned'
expect
(
users
[
1
].
text
).
to
eq
'Unassigned'
users
[
2
].
text
.
should
==
current_user
.
name
expect
(
users
[
2
].
text
).
to
eq
current_user
.
name
end
end
step
'I submit new issue "500 error on profile"'
do
step
'I submit new issue "500 error on profile"'
do
...
@@ -87,16 +87,16 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -87,16 +87,16 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
end
step
'I should see label \'bug\' with issue'
do
step
'I should see label \'bug\' with issue'
do
within
'.issue-show-labels'
do
page
.
within
'.issue-show-labels'
do
page
.
should
have_content
'bug'
expect
(
page
).
to
have_content
'bug'
end
end
end
end
step
'I should see issue "500 error on profile"'
do
step
'I should see issue "500 error on profile"'
do
issue
=
Issue
.
find_by
(
title:
"500 error on profile"
)
issue
=
Issue
.
find_by
(
title:
"500 error on profile"
)
page
.
should
have_content
issue
.
title
expect
(
page
).
to
have_content
issue
.
title
page
.
should
have_content
issue
.
author_name
expect
(
page
).
to
have_content
issue
.
author_name
page
.
should
have_content
issue
.
project
.
name
expect
(
page
).
to
have_content
issue
.
project
.
name
end
end
step
'I fill in issue search with "Re"'
do
step
'I fill in issue search with "Re"'
do
...
@@ -139,7 +139,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -139,7 +139,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
step
'I should see selected milestone with title "v3.0"'
do
step
'I should see selected milestone with title "v3.0"'
do
issues_milestone_selector
=
"#issue_milestone_id_chzn > a"
issues_milestone_selector
=
"#issue_milestone_id_chzn > a"
find
(
issues_milestone_selector
).
should
have_content
(
"v3.0"
)
expect
(
find
(
issues_milestone_selector
)).
to
have_content
(
"v3.0"
)
end
end
When
'I select first assignee from "Shop" project'
do
When
'I select first assignee from "Shop" project'
do
...
@@ -152,7 +152,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -152,7 +152,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
issues_assignee_selector
=
"#issue_assignee_id_chzn > a"
issues_assignee_selector
=
"#issue_assignee_id_chzn > a"
assignee_name
=
project
.
users
.
first
.
name
assignee_name
=
project
.
users
.
first
.
name
find
(
issues_assignee_selector
).
should
have_content
(
assignee_name
)
expect
(
find
(
issues_assignee_selector
)).
to
have_content
(
assignee_name
)
end
end
step
'project "Shop" have "Release 0.4" open issue'
do
step
'project "Shop" have "Release 0.4" open issue'
do
...
@@ -190,8 +190,8 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -190,8 +190,8 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
step
'I see empty project details with ssh clone info'
do
step
'I see empty project details with ssh clone info'
do
project
=
Project
.
find_by
(
name:
'Empty Project'
)
project
=
Project
.
find_by
(
name:
'Empty Project'
)
all
(
:css
,
'.git-empty .clone'
).
each
do
|
element
|
page
.
all
(
:css
,
'.git-empty .clone'
).
each
do
|
element
|
e
lement
.
text
.
should
include
(
project
.
url_to_repo
)
e
xpect
(
element
.
text
).
to
include
(
project
.
url_to_repo
)
end
end
end
end
...
@@ -201,7 +201,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -201,7 +201,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
end
step
'I leave a comment with code block'
do
step
'I leave a comment with code block'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
fill_in
"note[note]"
,
with:
"```
\n
Command [1]: /usr/local/bin/git , see [text](doc/text)
\n
```"
fill_in
"note[note]"
,
with:
"```
\n
Command [1]: /usr/local/bin/git , see [text](doc/text)
\n
```"
click_button
"Add Comment"
click_button
"Add Comment"
sleep
0.05
sleep
0.05
...
@@ -209,13 +209,13 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -209,13 +209,13 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
end
step
'I should see an error alert section within the comment form'
do
step
'I should see an error alert section within the comment form'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
find
(
".error-alert"
)
find
(
".error-alert"
)
end
end
end
end
step
'The code block should be unchanged'
do
step
'The code block should be unchanged'
do
page
.
should
have_content
(
"```
\n
Command [1]: /usr/local/bin/git , see [text](doc/text)
\n
```"
)
expect
(
page
).
to
have_content
(
"```
\n
Command [1]: /usr/local/bin/git , see [text](doc/text)
\n
```"
)
end
end
step
'project \'Shop\' has issue \'Bugfix1\' with description: \'Description for issue1\''
do
step
'project \'Shop\' has issue \'Bugfix1\' with description: \'Description for issue1\''
do
...
@@ -239,15 +239,15 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -239,15 +239,15 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
end
step
'I should see \'Bugfix1\' in issues'
do
step
'I should see \'Bugfix1\' in issues'
do
page
.
should
have_content
'Bugfix1'
expect
(
page
).
to
have_content
'Bugfix1'
end
end
step
'I should see \'Feature1\' in issues'
do
step
'I should see \'Feature1\' in issues'
do
page
.
should
have_content
'Feature1'
expect
(
page
).
to
have_content
'Feature1'
end
end
step
'I should not see \'Bugfix1\' in issues'
do
step
'I should not see \'Bugfix1\' in issues'
do
page
.
should_not
have_content
'Bugfix1'
expect
(
page
).
not_to
have_content
'Bugfix1'
end
end
step
'issue \'Release 0.4\' has label \'bug\''
do
step
'issue \'Release 0.4\' has label \'bug\''
do
...
@@ -257,7 +257,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
...
@@ -257,7 +257,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
end
step
'I click label \'bug\''
do
step
'I click label \'bug\''
do
within
".issues-list"
do
page
.
within
".issues-list"
do
click_link
'bug'
click_link
'bug'
end
end
end
end
...
...
features/steps/project/issues/labels.rb
View file @
8949758f
...
@@ -8,14 +8,14 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
...
@@ -8,14 +8,14 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
end
end
step
'I remove label \'bug\''
do
step
'I remove label \'bug\''
do
within
"#label_
#{
bug_label
.
id
}
"
do
page
.
within
"#label_
#{
bug_label
.
id
}
"
do
click_link
'Remove'
click_link
'Remove'
end
end
end
end
step
'I delete all labels'
do
step
'I delete all labels'
do
within
'.labels'
do
page
.
within
'.labels'
do
all
(
'.btn-remove'
).
each
do
|
remove
|
page
.
all
(
'.btn-remove'
).
each
do
|
remove
|
remove
.
click
remove
.
click
sleep
0.05
sleep
0.05
end
end
...
@@ -23,8 +23,8 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
...
@@ -23,8 +23,8 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
end
end
step
'I should see labels help message'
do
step
'I should see labels help message'
do
within
'.labels'
do
page
.
within
'.labels'
do
page
.
should
have_content
'Create first label or generate default set of '
\
expect
(
page
).
to
have_content
'Create first label or generate default set of '
\
'labels'
'labels'
end
end
end
end
...
@@ -48,38 +48,38 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
...
@@ -48,38 +48,38 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
end
end
step
'I should see label label exist error message'
do
step
'I should see label label exist error message'
do
within
'.label-form'
do
page
.
within
'.label-form'
do
page
.
should
have_content
'Title has already been taken'
expect
(
page
).
to
have_content
'Title has already been taken'
end
end
end
end
step
'I should see label color error message'
do
step
'I should see label color error message'
do
within
'.label-form'
do
page
.
within
'.label-form'
do
page
.
should
have_content
'Color is invalid'
expect
(
page
).
to
have_content
'Color is invalid'
end
end
end
end
step
'I should see label \'feature\''
do
step
'I should see label \'feature\''
do
within
'.manage-labels-list'
do
page
.
within
'.manage-labels-list'
do
page
.
should
have_content
'feature'
expect
(
page
).
to
have_content
'feature'
end
end
end
end
step
'I should see label \'bug\''
do
step
'I should see label \'bug\''
do
within
'.manage-labels-list'
do
page
.
within
'.manage-labels-list'
do
page
.
should
have_content
'bug'
expect
(
page
).
to
have_content
'bug'
end
end
end
end
step
'I should not see label \'bug\''
do
step
'I should not see label \'bug\''
do
within
'.manage-labels-list'
do
page
.
within
'.manage-labels-list'
do
page
.
should_not
have_content
'bug'
expect
(
page
).
not_to
have_content
'bug'
end
end
end
end
step
'I should see label \'support\''
do
step
'I should see label \'support\''
do
within
'.manage-labels-list'
do
page
.
within
'.manage-labels-list'
do
page
.
should
have_content
'support'
expect
(
page
).
to
have_content
'support'
end
end
end
end
...
@@ -90,8 +90,8 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
...
@@ -90,8 +90,8 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
end
end
step
'I should see label \'fix\''
do
step
'I should see label \'fix\''
do
within
'.manage-labels-list'
do
page
.
within
'.manage-labels-list'
do
page
.
should
have_content
'fix'
expect
(
page
).
to
have_content
'fix'
end
end
end
end
...
...
features/steps/project/issues/milestones.rb
View file @
8949758f
...
@@ -6,9 +6,9 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
...
@@ -6,9 +6,9 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
step
'I should see milestone "v2.2"'
do
step
'I should see milestone "v2.2"'
do
milestone
=
@project
.
milestones
.
find_by
(
title:
"v2.2"
)
milestone
=
@project
.
milestones
.
find_by
(
title:
"v2.2"
)
page
.
should
have_content
(
milestone
.
title
[
0
..
10
])
expect
(
page
).
to
have_content
(
milestone
.
title
[
0
..
10
])
page
.
should
have_content
(
milestone
.
expires_at
)
expect
(
page
).
to
have_content
(
milestone
.
expires_at
)
page
.
should
have_content
(
"Issues"
)
expect
(
page
).
to
have_content
(
"Issues"
)
end
end
step
'I click link "v2.2"'
do
step
'I click link "v2.2"'
do
...
@@ -26,9 +26,9 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
...
@@ -26,9 +26,9 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
step
'I should see milestone "v2.3"'
do
step
'I should see milestone "v2.3"'
do
milestone
=
@project
.
milestones
.
find_by
(
title:
"v2.3"
)
milestone
=
@project
.
milestones
.
find_by
(
title:
"v2.3"
)
page
.
should
have_content
(
milestone
.
title
[
0
..
10
])
expect
(
page
).
to
have_content
(
milestone
.
title
[
0
..
10
])
page
.
should
have_content
(
milestone
.
expires_at
)
expect
(
page
).
to
have_content
(
milestone
.
expires_at
)
page
.
should
have_content
(
"Issues"
)
expect
(
page
).
to
have_content
(
"Issues"
)
end
end
step
'project "Shop" has milestone "v2.2"'
do
step
'project "Shop" has milestone "v2.2"'
do
...
@@ -54,6 +54,6 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
...
@@ -54,6 +54,6 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
end
end
step
'I should see 3 issues'
do
step
'I should see 3 issues'
do
page
.
should
have_selector
(
'#tab-issues li.issue-row'
,
count:
4
)
expect
(
page
).
to
have_selector
(
'#tab-issues li.issue-row'
,
count:
4
)
end
end
end
end
features/steps/project/merge_requests.rb
View file @
8949758f
...
@@ -24,44 +24,44 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -24,44 +24,44 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see merge request "Wiki Feature"'
do
step
'I should see merge request "Wiki Feature"'
do
within
'.merge-request'
do
page
.
within
'.merge-request'
do
page
.
should
have_content
"Wiki Feature"
expect
(
page
).
to
have_content
"Wiki Feature"
end
end
end
end
step
'I should see closed merge request "Bug NS-04"'
do
step
'I should see closed merge request "Bug NS-04"'
do
merge_request
=
MergeRequest
.
find_by!
(
title:
"Bug NS-04"
)
merge_request
=
MergeRequest
.
find_by!
(
title:
"Bug NS-04"
)
merge_request
.
closed?
.
should
be_true
expect
(
merge_request
.
closed?
).
to
be_true
page
.
should
have_content
"Rejected by"
expect
(
page
).
to
have_content
"Rejected by"
end
end
step
'I should see merge request "Bug NS-04"'
do
step
'I should see merge request "Bug NS-04"'
do
page
.
should
have_content
"Bug NS-04"
expect
(
page
).
to
have_content
"Bug NS-04"
end
end
step
'I should see "Bug NS-04" in merge requests'
do
step
'I should see "Bug NS-04" in merge requests'
do
page
.
should
have_content
"Bug NS-04"
expect
(
page
).
to
have_content
"Bug NS-04"
end
end
step
'I should see "Feature NS-03" in merge requests'
do
step
'I should see "Feature NS-03" in merge requests'
do
page
.
should
have_content
"Feature NS-03"
expect
(
page
).
to
have_content
"Feature NS-03"
end
end
step
'I should not see "Feature NS-03" in merge requests'
do
step
'I should not see "Feature NS-03" in merge requests'
do
page
.
should_not
have_content
"Feature NS-03"
expect
(
page
).
not_to
have_content
"Feature NS-03"
end
end
step
'I should not see "Bug NS-04" in merge requests'
do
step
'I should not see "Bug NS-04" in merge requests'
do
page
.
should_not
have_content
"Bug NS-04"
expect
(
page
).
not_to
have_content
"Bug NS-04"
end
end
step
'I should see that I am subscribed'
do
step
'I should see that I am subscribed'
do
find
(
".subscribe-button span"
).
text
.
should
==
"Unsubscribe"
expect
(
find
(
".subscribe-button span"
).
text
).
to
eq
"Unsubscribe"
end
end
step
'I should see that I am unsubscribed'
do
step
'I should see that I am unsubscribed'
do
find
(
".subscribe-button span"
).
should
have_content
(
"Subscribe"
)
expect
(
find
(
".subscribe-button span"
)).
to
have_content
(
"Subscribe"
)
end
end
step
'I click button "Unsubscribe"'
do
step
'I click button "Unsubscribe"'
do
...
@@ -113,7 +113,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -113,7 +113,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I click on the Changes tab via Javascript'
do
step
'I click on the Changes tab via Javascript'
do
within
'.merge-request-tabs'
do
page
.
within
'.merge-request-tabs'
do
click_link
'Changes'
click_link
'Changes'
end
end
...
@@ -121,11 +121,11 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -121,11 +121,11 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see the proper Inline and Side-by-side links'
do
step
'I should see the proper Inline and Side-by-side links'
do
buttons
=
all
(
'#commit-diff-viewtype'
)
buttons
=
page
.
all
(
'#commit-diff-viewtype'
)
expect
(
buttons
.
count
).
to
eq
(
2
)
expect
(
buttons
.
count
).
to
eq
(
2
)
buttons
.
each
do
|
b
|
buttons
.
each
do
|
b
|
expect
(
b
[
'href'
]).
should_not
have_content
(
'json'
)
expect
(
expect
(
b
[
'href'
])).
not_to
have_content
(
'json'
)
end
end
end
end
...
@@ -134,11 +134,11 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -134,11 +134,11 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I click on the commit in the merge request'
do
step
'I click on the commit in the merge request'
do
within
'.merge-request-tabs'
do
page
.
within
'.merge-request-tabs'
do
click_link
'Commits'
click_link
'Commits'
end
end
within
'.commits'
do
page
.
within
'.commits'
do
click_link
Commit
.
truncate_sha
(
sample_commit
.
id
)
click_link
Commit
.
truncate_sha
(
sample_commit
.
id
)
end
end
end
end
...
@@ -164,24 +164,24 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -164,24 +164,24 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see a discussion has started on diff'
do
step
'I should see a discussion has started on diff'
do
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion"
expect
(
page
).
to
have_content
"
#{
current_user
.
name
}
started a discussion"
page
.
should
have_content
sample_commit
.
line_code_path
expect
(
page
).
to
have_content
sample_commit
.
line_code_path
page
.
should
have_content
"Line is wrong"
expect
(
page
).
to
have_content
"Line is wrong"
end
end
step
'I should see a discussion has started on commit diff'
do
step
'I should see a discussion has started on commit diff'
do
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion on commit"
expect
(
page
).
to
have_content
"
#{
current_user
.
name
}
started a discussion on commit"
page
.
should
have_content
sample_commit
.
line_code_path
expect
(
page
).
to
have_content
sample_commit
.
line_code_path
page
.
should
have_content
"Line is wrong"
expect
(
page
).
to
have_content
"Line is wrong"
end
end
step
'I should see a discussion has started on commit'
do
step
'I should see a discussion has started on commit'
do
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion on commit"
expect
(
page
).
to
have_content
"
#{
current_user
.
name
}
started a discussion on commit"
page
.
should
have_content
"One comment to rule them all"
expect
(
page
).
to
have_content
"One comment to rule them all"
end
end
step
'merge request is mergeable'
do
step
'merge request is mergeable'
do
page
.
should
have_button
'Accept Merge Request'
expect
(
page
).
to
have_button
'Accept Merge Request'
end
end
step
'I modify merge commit message'
do
step
'I modify merge commit message'
do
...
@@ -199,14 +199,14 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -199,14 +199,14 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
merge!:
true
,
merge!:
true
,
)
)
within
'.mr-state-widget'
do
page
.
within
'.mr-state-widget'
do
click_button
"Accept Merge Request"
click_button
"Accept Merge Request"
end
end
end
end
step
'I should see merged request'
do
step
'I should see merged request'
do
within
'.issue-box'
do
page
.
within
'.issue-box'
do
page
.
should
have_content
"Accepted"
expect
(
page
).
to
have_content
"Accepted"
end
end
end
end
...
@@ -215,72 +215,72 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -215,72 +215,72 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see reopened merge request "Bug NS-04"'
do
step
'I should see reopened merge request "Bug NS-04"'
do
within
'.issue-box'
do
page
.
within
'.issue-box'
do
page
.
should
have_content
"Open"
expect
(
page
).
to
have_content
"Open"
end
end
end
end
step
'I click link "Hide inline discussion" of the second file'
do
step
'I click link "Hide inline discussion" of the second file'
do
within
'.files [id^=diff]:nth-child(2)'
do
page
.
within
'.files [id^=diff]:nth-child(2)'
do
find
(
'.js-toggle-diff-comments'
).
click
find
(
'.js-toggle-diff-comments'
).
click
end
end
end
end
step
'I click link "Show inline discussion" of the second file'
do
step
'I click link "Show inline discussion" of the second file'
do
within
'.files [id^=diff]:nth-child(2)'
do
page
.
within
'.files [id^=diff]:nth-child(2)'
do
find
(
'.js-toggle-diff-comments'
).
click
find
(
'.js-toggle-diff-comments'
).
click
end
end
end
end
step
'I should not see a comment like "Line is wrong" in the second file'
do
step
'I should not see a comment like "Line is wrong" in the second file'
do
within
'.files [id^=diff]:nth-child(2)'
do
page
.
within
'.files [id^=diff]:nth-child(2)'
do
page
.
should_not
have_visible_content
"Line is wrong"
expect
(
page
).
not_to
have_visible_content
"Line is wrong"
end
end
end
end
step
'I should see a comment like "Line is wrong" in the second file'
do
step
'I should see a comment like "Line is wrong" in the second file'
do
within
'.files [id^=diff]:nth-child(2) .note-body > .note-text'
do
page
.
within
'.files [id^=diff]:nth-child(2) .note-body > .note-text'
do
page
.
should
have_visible_content
"Line is wrong"
expect
(
page
).
to
have_visible_content
"Line is wrong"
end
end
end
end
step
'I should not see a comment like "Line is wrong here" in the second file'
do
step
'I should not see a comment like "Line is wrong here" in the second file'
do
within
'.files [id^=diff]:nth-child(2)'
do
page
.
within
'.files [id^=diff]:nth-child(2)'
do
page
.
should_not
have_visible_content
"Line is wrong here"
expect
(
page
).
not_to
have_visible_content
"Line is wrong here"
end
end
end
end
step
'I should see a comment like "Line is wrong here" in the second file'
do
step
'I should see a comment like "Line is wrong here" in the second file'
do
within
'.files [id^=diff]:nth-child(2) .note-body > .note-text'
do
page
.
within
'.files [id^=diff]:nth-child(2) .note-body > .note-text'
do
page
.
should
have_visible_content
"Line is wrong here"
expect
(
page
).
to
have_visible_content
"Line is wrong here"
end
end
end
end
step
'I leave a comment like "Line is correct" on line 12 of the first file'
do
step
'I leave a comment like "Line is correct" on line 12 of the first file'
do
init_diff_note_first_file
init_diff_note_first_file
within
(
".js-discussion-note-form"
)
do
page
.
within
(
".js-discussion-note-form"
)
do
fill_in
"note_note"
,
with:
"Line is correct"
fill_in
"note_note"
,
with:
"Line is correct"
click_button
"Add Comment"
click_button
"Add Comment"
end
end
within
".files [id^=diff]:nth-child(1) .note-body > .note-text"
do
page
.
within
".files [id^=diff]:nth-child(1) .note-body > .note-text"
do
page
.
should
have_content
"Line is correct"
expect
(
page
).
to
have_content
"Line is correct"
end
end
end
end
step
'I leave a comment like "Line is wrong" on line 39 of the second file'
do
step
'I leave a comment like "Line is wrong" on line 39 of the second file'
do
init_diff_note_second_file
init_diff_note_second_file
within
(
".js-discussion-note-form"
)
do
page
.
within
(
".js-discussion-note-form"
)
do
fill_in
"note_note"
,
with:
"Line is wrong on here"
fill_in
"note_note"
,
with:
"Line is wrong on here"
click_button
"Add Comment"
click_button
"Add Comment"
end
end
end
end
step
'I should still see a comment like "Line is correct" in the first file'
do
step
'I should still see a comment like "Line is correct" in the first file'
do
within
'.files [id^=diff]:nth-child(1) .note-body > .note-text'
do
page
.
within
'.files [id^=diff]:nth-child(1) .note-body > .note-text'
do
page
.
should
have_visible_content
"Line is correct"
expect
(
page
).
to
have_visible_content
"Line is correct"
end
end
end
end
...
@@ -297,8 +297,8 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -297,8 +297,8 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see comments on the side-by-side diff page'
do
step
'I should see comments on the side-by-side diff page'
do
within
'.files [id^=diff]:nth-child(1) .parallel .note-body > .note-text'
do
page
.
within
'.files [id^=diff]:nth-child(1) .parallel .note-body > .note-text'
do
page
.
should
have_visible_content
"Line is correct"
expect
(
page
).
to
have_visible_content
"Line is correct"
end
end
end
end
...
@@ -316,8 +316,8 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -316,8 +316,8 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see new target branch changes'
do
step
'I should see new target branch changes'
do
page
.
should
have_content
'From fix into feature'
expect
(
page
).
to
have_content
'From fix into feature'
page
.
should
have_content
'Target branch changed from master to feature'
expect
(
page
).
to
have_content
'Target branch changed from master to feature'
end
end
def
merge_request
def
merge_request
...
@@ -329,12 +329,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -329,12 +329,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
def
leave_comment
(
message
)
def
leave_comment
(
message
)
within
(
".js-discussion-note-form"
)
do
page
.
within
(
".js-discussion-note-form"
)
do
fill_in
"note_note"
,
with:
message
fill_in
"note_note"
,
with:
message
click_button
"Add Comment"
click_button
"Add Comment"
end
end
page
.
should
have_content
message
expect
(
page
).
to
have_content
message
end
end
def
init_diff_note_first_file
def
init_diff_note_first_file
...
...
features/steps/project/network_graph.rb
View file @
8949758f
...
@@ -4,7 +4,7 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
...
@@ -4,7 +4,7 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
include
SharedProject
include
SharedProject
step
'page should have network graph'
do
step
'page should have network graph'
do
page
.
should
have_selector
".network-graph"
expect
(
page
).
to
have_selector
".network-graph"
end
end
When
'I visit project "Shop" network page'
do
When
'I visit project "Shop" network page'
do
...
@@ -16,16 +16,16 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
...
@@ -16,16 +16,16 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
end
end
step
'page should select "master" in select box'
do
step
'page should select "master" in select box'
do
page
.
should
have_selector
'.select2-chosen'
,
text:
"master"
expect
(
page
).
to
have_selector
'.select2-chosen'
,
text:
"master"
end
end
step
'page should select "v1.0.0" in select box'
do
step
'page should select "v1.0.0" in select box'
do
page
.
should
have_selector
'.select2-chosen'
,
text:
"v1.0.0"
expect
(
page
).
to
have_selector
'.select2-chosen'
,
text:
"v1.0.0"
end
end
step
'page should have "master" on graph'
do
step
'page should have "master" on graph'
do
within
'.network-graph'
do
page
.
within
'.network-graph'
do
page
.
should
have_content
'master'
expect
(
page
).
to
have_content
'master'
end
end
end
end
...
@@ -45,33 +45,33 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
...
@@ -45,33 +45,33 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
end
end
step
'page should have content not containing "v1.0.0"'
do
step
'page should have content not containing "v1.0.0"'
do
within
'.network-graph'
do
page
.
within
'.network-graph'
do
page
.
should
have_content
'Change some files'
expect
(
page
).
to
have_content
'Change some files'
end
end
end
end
step
'page should not have content not containing "v1.0.0"'
do
step
'page should not have content not containing "v1.0.0"'
do
within
'.network-graph'
do
page
.
within
'.network-graph'
do
page
.
should_not
have_content
'Change some files'
expect
(
page
).
not_to
have_content
'Change some files'
end
end
end
end
step
'page should select "feature" in select box'
do
step
'page should select "feature" in select box'
do
page
.
should
have_selector
'.select2-chosen'
,
text:
"feature"
expect
(
page
).
to
have_selector
'.select2-chosen'
,
text:
"feature"
end
end
step
'page should select "v1.0.0" in select box'
do
step
'page should select "v1.0.0" in select box'
do
page
.
should
have_selector
'.select2-chosen'
,
text:
"v1.0.0"
expect
(
page
).
to
have_selector
'.select2-chosen'
,
text:
"v1.0.0"
end
end
step
'page should have "feature" on graph'
do
step
'page should have "feature" on graph'
do
within
'.network-graph'
do
page
.
within
'.network-graph'
do
page
.
should
have_content
'feature'
expect
(
page
).
to
have_content
'feature'
end
end
end
end
When
'I looking for a commit by SHA of "v1.0.0"'
do
When
'I looking for a commit by SHA of "v1.0.0"'
do
within
".network-form"
do
page
.
within
".network-form"
do
fill_in
'extended_sha1'
,
with:
'6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
fill_in
'extended_sha1'
,
with:
'6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
find
(
'button'
).
click
find
(
'button'
).
click
end
end
...
@@ -79,13 +79,13 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
...
@@ -79,13 +79,13 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
end
end
step
'page should have "v1.0.0" on graph'
do
step
'page should have "v1.0.0" on graph'
do
within
'.network-graph'
do
page
.
within
'.network-graph'
do
page
.
should
have_content
'v1.0.0'
expect
(
page
).
to
have_content
'v1.0.0'
end
end
end
end
When
'I look for a commit by ";"'
do
When
'I look for a commit by ";"'
do
within
".network-form"
do
page
.
within
".network-form"
do
fill_in
'extended_sha1'
,
with:
';'
fill_in
'extended_sha1'
,
with:
';'
find
(
'button'
).
click
find
(
'button'
).
click
end
end
...
...
features/steps/project/project.rb
View file @
8949758f
...
@@ -13,7 +13,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -13,7 +13,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
end
step
'I should see project with new settings'
do
step
'I should see project with new settings'
do
find_field
(
'project_name'
).
value
.
should
==
'NewName'
expect
(
find_field
(
'project_name'
).
value
).
to
eq
'NewName'
end
end
step
'change project path settings'
do
step
'change project path settings'
do
...
@@ -22,7 +22,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -22,7 +22,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
end
step
'I should see project with new path settings'
do
step
'I should see project with new path settings'
do
project
.
path
.
should
==
'new-path'
expect
(
project
.
path
).
to
eq
'new-path'
end
end
step
'I change the project avatar'
do
step
'I change the project avatar'
do
...
@@ -35,13 +35,13 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -35,13 +35,13 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
end
step
'I should see new project avatar'
do
step
'I should see new project avatar'
do
@project
.
avatar
.
should
be_instance_of
AvatarUploader
expect
(
@project
.
avatar
).
to
be_instance_of
AvatarUploader
url
=
@project
.
avatar
.
url
url
=
@project
.
avatar
.
url
url
.
should
==
"/uploads/project/avatar/
#{
@project
.
id
}
/gitlab_logo.png"
expect
(
url
).
to
eq
"/uploads/project/avatar/
#{
@project
.
id
}
/gitlab_logo.png"
end
end
step
'I should see the "Remove avatar" button'
do
step
'I should see the "Remove avatar" button'
do
page
.
should
have_link
(
'Remove avatar'
)
expect
(
page
).
to
have_link
(
'Remove avatar'
)
end
end
step
'I have an project avatar'
do
step
'I have an project avatar'
do
...
@@ -59,16 +59,16 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -59,16 +59,16 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
end
step
'I should see the default project avatar'
do
step
'I should see the default project avatar'
do
@project
.
avatar?
.
should
be_false
expect
(
@project
.
avatar?
).
to
be_false
end
end
step
'I should not see the "Remove avatar" button'
do
step
'I should not see the "Remove avatar" button'
do
page
.
should_not
have_link
(
'Remove avatar'
)
expect
(
page
).
not_to
have_link
(
'Remove avatar'
)
end
end
step
'I should see project "Shop" version'
do
step
'I should see project "Shop" version'
do
within
'.project-side'
do
page
.
within
'.project-side'
do
page
.
should
have_content
'6.7.0.pre'
expect
(
page
).
to
have_content
'6.7.0.pre'
end
end
end
end
...
@@ -78,7 +78,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -78,7 +78,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
end
step
'I should see project default branch changed'
do
step
'I should see project default branch changed'
do
find
(
:css
,
'select#project_default_branch'
).
value
.
should
==
'fix'
expect
(
find
(
:css
,
'select#project_default_branch'
).
value
).
to
eq
'fix'
end
end
step
'I select project "Forum" README tab'
do
step
'I select project "Forum" README tab'
do
...
@@ -86,13 +86,13 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -86,13 +86,13 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
end
step
'I should see project "Forum" README'
do
step
'I should see project "Forum" README'
do
page
.
should
have_link
'README.md'
expect
(
page
).
to
have_link
'README.md'
page
.
should
have_content
'Sample repo for testing gitlab features'
expect
(
page
).
to
have_content
'Sample repo for testing gitlab features'
end
end
step
'I should see project "Shop" README'
do
step
'I should see project "Shop" README'
do
page
.
should
have_link
'README.md'
expect
(
page
).
to
have_link
'README.md'
page
.
should
have_content
'testme'
expect
(
page
).
to
have_content
'testme'
end
end
step
'I add project tags'
do
step
'I add project tags'
do
...
@@ -104,14 +104,14 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -104,14 +104,14 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
end
step
'I should not see "New Issue" button'
do
step
'I should not see "New Issue" button'
do
page
.
should_not
have_link
'New Issue'
expect
(
page
).
not_to
have_link
'New Issue'
end
end
step
'I should not see "New Merge Request" button'
do
step
'I should not see "New Merge Request" button'
do
page
.
should_not
have_link
'New Merge Request'
expect
(
page
).
not_to
have_link
'New Merge Request'
end
end
step
'I should not see "Snippets" button'
do
step
'I should not see "Snippets" button'
do
page
.
should_not
have_link
'Snippets'
expect
(
page
).
not_to
have_link
'Snippets'
end
end
end
end
features/steps/project/redirects.rb
View file @
8949758f
...
@@ -18,8 +18,8 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
...
@@ -18,8 +18,8 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
step
'I should see project "Community" home page'
do
step
'I should see project "Community" home page'
do
Gitlab
.
config
.
gitlab
.
should_receive
(
:host
).
and_return
(
"www.example.com"
)
Gitlab
.
config
.
gitlab
.
should_receive
(
:host
).
and_return
(
"www.example.com"
)
within
'.navbar-gitlab .title'
do
page
.
within
'.navbar-gitlab .title'
do
page
.
should
have_content
'Community'
expect
(
page
).
to
have_content
'Community'
end
end
end
end
...
@@ -48,8 +48,8 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
...
@@ -48,8 +48,8 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
step
'I should be redirected to "Community" page'
do
step
'I should be redirected to "Community" page'
do
project
=
Project
.
find_by
(
name:
'Community'
)
project
=
Project
.
find_by
(
name:
'Community'
)
current_path
.
should
==
"/
#{
project
.
path_with_namespace
}
"
expect
(
current_path
).
to
eq
"/
#{
project
.
path_with_namespace
}
"
status_code
.
should
==
200
expect
(
status_code
).
to
eq
200
end
end
step
'I get redirected to signin page where I sign in'
do
step
'I get redirected to signin page where I sign in'
do
...
@@ -63,7 +63,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
...
@@ -63,7 +63,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
step
'I should be redirected to "Enterprise" page'
do
step
'I should be redirected to "Enterprise" page'
do
project
=
Project
.
find_by
(
name:
'Enterprise'
)
project
=
Project
.
find_by
(
name:
'Enterprise'
)
current_path
.
should
==
"/
#{
project
.
path_with_namespace
}
"
expect
(
current_path
).
to
eq
"/
#{
project
.
path_with_namespace
}
"
status_code
.
should
==
200
expect
(
status_code
).
to
eq
200
end
end
end
end
features/steps/project/services.rb
View file @
8949758f
...
@@ -8,16 +8,16 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -8,16 +8,16 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see list of available services'
do
step
'I should see list of available services'
do
page
.
should
have_content
'Project services'
expect
(
page
).
to
have_content
'Project services'
page
.
should
have_content
'Campfire'
expect
(
page
).
to
have_content
'Campfire'
page
.
should
have_content
'HipChat'
expect
(
page
).
to
have_content
'HipChat'
page
.
should
have_content
'GitLab CI'
expect
(
page
).
to
have_content
'GitLab CI'
page
.
should
have_content
'Assembla'
expect
(
page
).
to
have_content
'Assembla'
page
.
should
have_content
'Pushover'
expect
(
page
).
to
have_content
'Pushover'
page
.
should
have_content
'Atlassian Bamboo'
expect
(
page
).
to
have_content
'Atlassian Bamboo'
page
.
should
have_content
'JetBrains TeamCity'
expect
(
page
).
to
have_content
'JetBrains TeamCity'
page
.
should
have_content
'Asana'
expect
(
page
).
to
have_content
'Asana'
page
.
should
have_content
'Irker (IRC gateway)'
expect
(
page
).
to
have_content
'Irker (IRC gateway)'
end
end
step
'I click gitlab-ci service link'
do
step
'I click gitlab-ci service link'
do
...
@@ -32,7 +32,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -32,7 +32,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see service settings saved'
do
step
'I should see service settings saved'
do
find_field
(
'Project url'
).
value
.
should
==
'http://ci.gitlab.org/projects/3'
expect
(
find_field
(
'Project url'
).
value
).
to
eq
'http://ci.gitlab.org/projects/3'
end
end
step
'I click hipchat service link'
do
step
'I click hipchat service link'
do
...
@@ -47,7 +47,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -47,7 +47,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see hipchat service settings saved'
do
step
'I should see hipchat service settings saved'
do
find_field
(
'Room'
).
value
.
should
==
'gitlab'
expect
(
find_field
(
'Room'
).
value
).
to
eq
'gitlab'
end
end
step
'I fill hipchat settings with custom server'
do
step
'I fill hipchat settings with custom server'
do
...
@@ -59,7 +59,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -59,7 +59,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see hipchat service settings with custom server saved'
do
step
'I should see hipchat service settings with custom server saved'
do
find_field
(
'Server'
).
value
.
should
==
'https://chat.example.com'
expect
(
find_field
(
'Server'
).
value
).
to
eq
'https://chat.example.com'
end
end
step
'I click pivotaltracker service link'
do
step
'I click pivotaltracker service link'
do
...
@@ -73,7 +73,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -73,7 +73,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see pivotaltracker service settings saved'
do
step
'I should see pivotaltracker service settings saved'
do
find_field
(
'Token'
).
value
.
should
==
'verySecret'
expect
(
find_field
(
'Token'
).
value
).
to
eq
'verySecret'
end
end
step
'I click Flowdock service link'
do
step
'I click Flowdock service link'
do
...
@@ -87,7 +87,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -87,7 +87,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see Flowdock service settings saved'
do
step
'I should see Flowdock service settings saved'
do
find_field
(
'Token'
).
value
.
should
==
'verySecret'
expect
(
find_field
(
'Token'
).
value
).
to
eq
'verySecret'
end
end
step
'I click Assembla service link'
do
step
'I click Assembla service link'
do
...
@@ -101,7 +101,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -101,7 +101,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see Assembla service settings saved'
do
step
'I should see Assembla service settings saved'
do
find_field
(
'Token'
).
value
.
should
==
'verySecret'
expect
(
find_field
(
'Token'
).
value
).
to
eq
'verySecret'
end
end
step
'I click Asana service link'
do
step
'I click Asana service link'
do
...
@@ -116,8 +116,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -116,8 +116,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see Asana service settings saved'
do
step
'I should see Asana service settings saved'
do
find_field
(
'Api key'
).
value
.
should
==
'verySecret'
expect
(
find_field
(
'Api key'
).
value
).
to
eq
'verySecret'
find_field
(
'Restrict to branch'
).
value
.
should
==
'master'
expect
(
find_field
(
'Restrict to branch'
).
value
).
to
eq
'master'
end
end
step
'I click email on push service link'
do
step
'I click email on push service link'
do
...
@@ -130,7 +130,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -130,7 +130,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see email on push service settings saved'
do
step
'I should see email on push service settings saved'
do
find_field
(
'Recipients'
).
value
.
should
==
'qa@company.name'
expect
(
find_field
(
'Recipients'
).
value
).
to
eq
'qa@company.name'
end
end
step
'I click Irker service link'
do
step
'I click Irker service link'
do
...
@@ -145,8 +145,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -145,8 +145,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see Irker service settings saved'
do
step
'I should see Irker service settings saved'
do
find_field
(
'Recipients'
).
value
.
should
==
'irc://chat.freenode.net/#commits'
expect
(
find_field
(
'Recipients'
).
value
).
to
eq
'irc://chat.freenode.net/#commits'
find_field
(
'Colorize messages'
).
value
.
should
==
'1'
expect
(
find_field
(
'Colorize messages'
).
value
).
to
eq
'1'
end
end
step
'I click Slack service link'
do
step
'I click Slack service link'
do
...
@@ -160,7 +160,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -160,7 +160,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see Slack service settings saved'
do
step
'I should see Slack service settings saved'
do
find_field
(
'Webhook'
).
value
.
should
==
'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685'
expect
(
find_field
(
'Webhook'
).
value
).
to
eq
'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685'
end
end
step
'I click Pushover service link'
do
step
'I click Pushover service link'
do
...
@@ -178,11 +178,11 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -178,11 +178,11 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see Pushover service settings saved'
do
step
'I should see Pushover service settings saved'
do
find_field
(
'Api key'
).
value
.
should
==
'verySecret'
expect
(
find_field
(
'Api key'
).
value
).
to
eq
'verySecret'
find_field
(
'User key'
).
value
.
should
==
'verySecret'
expect
(
find_field
(
'User key'
).
value
).
to
eq
'verySecret'
find_field
(
'Device'
).
value
.
should
==
'myDevice'
expect
(
find_field
(
'Device'
).
value
).
to
eq
'myDevice'
find_field
(
'Priority'
).
find
(
'option[selected]'
).
value
.
should
==
'1'
expect
(
find_field
(
'Priority'
).
find
(
'option[selected]'
).
value
).
to
eq
'1'
find_field
(
'Sound'
).
find
(
'option[selected]'
).
value
.
should
==
'bike'
expect
(
find_field
(
'Sound'
).
find
(
'option[selected]'
).
value
).
to
eq
'bike'
end
end
step
'I click Atlassian Bamboo CI service link'
do
step
'I click Atlassian Bamboo CI service link'
do
...
@@ -199,9 +199,9 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -199,9 +199,9 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see Atlassian Bamboo CI service settings saved'
do
step
'I should see Atlassian Bamboo CI service settings saved'
do
find_field
(
'Bamboo url'
).
value
.
should
==
'http://bamboo.example.com'
expect
(
find_field
(
'Bamboo url'
).
value
).
to
eq
'http://bamboo.example.com'
find_field
(
'Build key'
).
value
.
should
==
'KEY'
expect
(
find_field
(
'Build key'
).
value
).
to
eq
'KEY'
find_field
(
'Username'
).
value
.
should
==
'user'
expect
(
find_field
(
'Username'
).
value
).
to
eq
'user'
end
end
step
'I click JetBrains TeamCity CI service link'
do
step
'I click JetBrains TeamCity CI service link'
do
...
@@ -218,8 +218,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
...
@@ -218,8 +218,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
end
step
'I should see JetBrains TeamCity CI service settings saved'
do
step
'I should see JetBrains TeamCity CI service settings saved'
do
find_field
(
'Teamcity url'
).
value
.
should
==
'http://teamcity.example.com'
expect
(
find_field
(
'Teamcity url'
).
value
).
to
eq
'http://teamcity.example.com'
find_field
(
'Build type'
).
value
.
should
==
'GitlabTest_Build'
expect
(
find_field
(
'Build type'
).
value
).
to
eq
'GitlabTest_Build'
find_field
(
'Username'
).
value
.
should
==
'user'
expect
(
find_field
(
'Username'
).
value
).
to
eq
'user'
end
end
end
end
features/steps/project/snippets.rb
View file @
8949758f
...
@@ -30,19 +30,19 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
...
@@ -30,19 +30,19 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
end
end
step
'I should see "Snippet one" in snippets'
do
step
'I should see "Snippet one" in snippets'
do
page
.
should
have_content
"Snippet one"
expect
(
page
).
to
have_content
"Snippet one"
end
end
step
'I should not see "Snippet two" in snippets'
do
step
'I should not see "Snippet two" in snippets'
do
page
.
should_not
have_content
"Snippet two"
expect
(
page
).
not_to
have_content
"Snippet two"
end
end
step
'I should not see "Snippet one" in snippets'
do
step
'I should not see "Snippet one" in snippets'
do
page
.
should_not
have_content
"Snippet one"
expect
(
page
).
not_to
have_content
"Snippet one"
end
end
step
'I click link "Edit"'
do
step
'I click link "Edit"'
do
within
".file-title"
do
page
.
within
".file-title"
do
click_link
"Edit"
click_link
"Edit"
end
end
end
end
...
@@ -54,15 +54,15 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
...
@@ -54,15 +54,15 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
step
'I submit new snippet "Snippet three"'
do
step
'I submit new snippet "Snippet three"'
do
fill_in
"project_snippet_title"
,
:with
=>
"Snippet three"
fill_in
"project_snippet_title"
,
:with
=>
"Snippet three"
fill_in
"project_snippet_file_name"
,
:with
=>
"my_snippet.rb"
fill_in
"project_snippet_file_name"
,
:with
=>
"my_snippet.rb"
within
(
'.file-editor'
)
do
page
.
within
(
'.file-editor'
)
do
find
(
:xpath
,
"//input[@id='project_snippet_content']"
).
set
'Content of snippet three'
find
(
:xpath
,
"//input[@id='project_snippet_content']"
).
set
'Content of snippet three'
end
end
click_button
"Create snippet"
click_button
"Create snippet"
end
end
step
'I should see snippet "Snippet three"'
do
step
'I should see snippet "Snippet three"'
do
page
.
should
have_content
"Snippet three"
expect
(
page
).
to
have_content
"Snippet three"
page
.
should
have_content
"Content of snippet three"
expect
(
page
).
to
have_content
"Content of snippet three"
end
end
step
'I submit new title "Snippet new title"'
do
step
'I submit new title "Snippet new title"'
do
...
@@ -71,18 +71,18 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
...
@@ -71,18 +71,18 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
end
end
step
'I should see "Snippet new title"'
do
step
'I should see "Snippet new title"'
do
page
.
should
have_content
"Snippet new title"
expect
(
page
).
to
have_content
"Snippet new title"
end
end
step
'I leave a comment like "Good snippet!"'
do
step
'I leave a comment like "Good snippet!"'
do
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
fill_in
"note_note"
,
with:
"Good snippet!"
fill_in
"note_note"
,
with:
"Good snippet!"
click_button
"Add Comment"
click_button
"Add Comment"
end
end
end
end
step
'I should see comment "Good snippet!"'
do
step
'I should see comment "Good snippet!"'
do
page
.
should
have_content
"Good snippet!"
expect
(
page
).
to
have_content
"Good snippet!"
end
end
step
'I visit snippet page "Snippet one"'
do
step
'I visit snippet page "Snippet one"'
do
...
...
features/steps/project/source/browse_files.rb
View file @
8949758f
...
@@ -5,23 +5,23 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -5,23 +5,23 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
include
RepoHelpers
include
RepoHelpers
step
'I should see files from repository'
do
step
'I should see files from repository'
do
page
.
should
have_content
"VERSION"
expect
(
page
).
to
have_content
"VERSION"
page
.
should
have_content
".gitignore"
expect
(
page
).
to
have_content
".gitignore"
page
.
should
have_content
"LICENSE"
expect
(
page
).
to
have_content
"LICENSE"
end
end
step
'I should see files from repository for "6d39438"'
do
step
'I should see files from repository for "6d39438"'
do
current_path
.
should
==
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"6d39438"
)
expect
(
current_path
).
to
eq
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"6d39438"
)
page
.
should
have_content
".gitignore"
expect
(
page
).
to
have_content
".gitignore"
page
.
should
have_content
"LICENSE"
expect
(
page
).
to
have_content
"LICENSE"
end
end
step
'I see the ".gitignore"'
do
step
'I see the ".gitignore"'
do
page
.
should
have_content
'.gitignore'
expect
(
page
).
to
have_content
'.gitignore'
end
end
step
'I don\'t see the ".gitignore"'
do
step
'I don\'t see the ".gitignore"'
do
page
.
should_not
have_content
'.gitignore'
expect
(
page
).
not_to
have_content
'.gitignore'
end
end
step
'I click on ".gitignore" file in repo'
do
step
'I click on ".gitignore" file in repo'
do
...
@@ -29,11 +29,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -29,11 +29,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
end
step
'I should see its content'
do
step
'I should see its content'
do
page
.
should
have_content
old_gitignore_content
expect
(
page
).
to
have_content
old_gitignore_content
end
end
step
'I should see its new content'
do
step
'I should see its new content'
do
page
.
should
have_content
new_gitignore_content
expect
(
page
).
to
have_content
new_gitignore_content
end
end
step
'I click link "Raw"'
do
step
'I click link "Raw"'
do
...
@@ -41,7 +41,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -41,7 +41,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
end
step
'I should see raw file content'
do
step
'I should see raw file content'
do
source
.
should
==
sample_blob
.
data
expect
(
source
).
to
eq
sample_blob
.
data
end
end
step
'I click button "Edit"'
do
step
'I click button "Edit"'
do
...
@@ -49,16 +49,16 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -49,16 +49,16 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
end
step
'I cannot see the edit button'
do
step
'I cannot see the edit button'
do
page
.
should_not
have_link
'edit'
expect
(
page
).
not_to
have_link
'edit'
end
end
step
'The edit button is disabled'
do
step
'The edit button is disabled'
do
page
.
should
have_css
'.disabled'
,
text:
'Edit'
expect
(
page
).
to
have_css
'.disabled'
,
text:
'Edit'
end
end
step
'I can edit code'
do
step
'I can edit code'
do
set_new_content
set_new_content
e
valuate_script
(
'blob.editor.getValue()'
).
should
==
new_gitignore_content
e
xpect
(
evaluate_script
(
'blob.editor.getValue()'
)).
to
eq
new_gitignore_content
end
end
step
'I edit code'
do
step
'I edit code'
do
...
@@ -98,7 +98,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -98,7 +98,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
end
step
'I see diff'
do
step
'I see diff'
do
page
.
should
have_css
'.line_holder.new'
expect
(
page
).
to
have_css
'.line_holder.new'
end
end
step
'I click on "new file" link in repo'
do
step
'I click on "new file" link in repo'
do
...
@@ -106,8 +106,8 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -106,8 +106,8 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
end
step
'I can see new file page'
do
step
'I can see new file page'
do
page
.
should
have_content
"New file"
expect
(
page
).
to
have_content
"New file"
page
.
should
have_content
"Commit message"
expect
(
page
).
to
have_content
"Commit message"
end
end
step
'I click on files directory'
do
step
'I click on files directory'
do
...
@@ -119,25 +119,25 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -119,25 +119,25 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
end
step
'I see Browse dir link'
do
step
'I see Browse dir link'
do
page
.
should
have_link
'Browse Dir »'
expect
(
page
).
to
have_link
'Browse Dir »'
page
.
should_not
have_link
'Browse Code »'
expect
(
page
).
not_to
have_link
'Browse Code »'
end
end
step
'I click on readme file'
do
step
'I click on readme file'
do
within
'.tree-table'
do
page
.
within
'.tree-table'
do
click_link
'README.md'
click_link
'README.md'
end
end
end
end
step
'I see Browse file link'
do
step
'I see Browse file link'
do
page
.
should
have_link
'Browse File »'
expect
(
page
).
to
have_link
'Browse File »'
page
.
should_not
have_link
'Browse Code »'
expect
(
page
).
not_to
have_link
'Browse Code »'
end
end
step
'I see Browse code link'
do
step
'I see Browse code link'
do
page
.
should
have_link
'Browse Code »'
expect
(
page
).
to
have_link
'Browse Code »'
page
.
should_not
have_link
'Browse File »'
expect
(
page
).
not_to
have_link
'Browse File »'
page
.
should_not
have_link
'Browse Dir »'
expect
(
page
).
not_to
have_link
'Browse Dir »'
end
end
step
'I click on Permalink'
do
step
'I click on Permalink'
do
...
@@ -145,7 +145,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -145,7 +145,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
end
step
'I am redirected to the files URL'
do
step
'I am redirected to the files URL'
do
current_path
.
should
==
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
'master'
)
expect
(
current_path
).
to
eq
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
'master'
)
end
end
step
'I am redirected to the ".gitignore"'
do
step
'I am redirected to the ".gitignore"'
do
...
...
features/steps/project/source/git_blame.rb
View file @
8949758f
...
@@ -12,8 +12,8 @@ class Spinach::Features::ProjectSourceGitBlame < Spinach::FeatureSteps
...
@@ -12,8 +12,8 @@ class Spinach::Features::ProjectSourceGitBlame < Spinach::FeatureSteps
end
end
step
'I should see git file blame'
do
step
'I should see git file blame'
do
page
.
should
have_content
"*.rb"
expect
(
page
).
to
have_content
"*.rb"
page
.
should
have_content
"Dmitriy Zaporozhets"
expect
(
page
).
to
have_content
"Dmitriy Zaporozhets"
page
.
should
have_content
"Initial commit"
expect
(
page
).
to
have_content
"Initial commit"
end
end
end
end
features/steps/project/source/markdown_render.rb
View file @
8949758f
...
@@ -13,19 +13,19 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -13,19 +13,19 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'I should see files from repository in markdown'
do
step
'I should see files from repository in markdown'
do
current_path
.
should
==
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown"
)
expect
(
current_path
).
to
eq
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown"
)
page
.
should
have_content
"README.md"
expect
(
page
).
to
have_content
"README.md"
page
.
should
have_content
"CHANGELOG"
expect
(
page
).
to
have_content
"CHANGELOG"
end
end
step
'I should see rendered README which contains correct links'
do
step
'I should see rendered README which contains correct links'
do
page
.
should
have_content
"Welcome to GitLab GitLab is a free project and repository management application"
expect
(
page
).
to
have_content
"Welcome to GitLab GitLab is a free project and repository management application"
page
.
should
have_link
"GitLab API doc"
expect
(
page
).
to
have_link
"GitLab API doc"
page
.
should
have_link
"GitLab API website"
expect
(
page
).
to
have_link
"GitLab API website"
page
.
should
have_link
"Rake tasks"
expect
(
page
).
to
have_link
"Rake tasks"
page
.
should
have_link
"backup and restore procedure"
expect
(
page
).
to
have_link
"backup and restore procedure"
page
.
should
have_link
"GitLab API doc directory"
expect
(
page
).
to
have_link
"GitLab API doc directory"
page
.
should
have_link
"Maintenance"
expect
(
page
).
to
have_link
"Maintenance"
end
end
step
'I click on Gitlab API in README'
do
step
'I click on Gitlab API in README'
do
...
@@ -33,8 +33,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -33,8 +33,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'I should see correct document rendered'
do
step
'I should see correct document rendered'
do
current_path
.
should
==
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
page
.
should
have_content
"All API requests require authentication"
expect
(
page
).
to
have_content
"All API requests require authentication"
end
end
step
'I click on Rake tasks in README'
do
step
'I click on Rake tasks in README'
do
...
@@ -42,9 +42,9 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -42,9 +42,9 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'I should see correct directory rendered'
do
step
'I should see correct directory rendered'
do
current_path
.
should
==
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown/doc/raketasks"
)
expect
(
current_path
).
to
eq
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown/doc/raketasks"
)
page
.
should
have_content
"backup_restore.md"
expect
(
page
).
to
have_content
"backup_restore.md"
page
.
should
have_content
"maintenance.md"
expect
(
page
).
to
have_content
"maintenance.md"
end
end
step
'I click on GitLab API doc directory in README'
do
step
'I click on GitLab API doc directory in README'
do
...
@@ -52,9 +52,9 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -52,9 +52,9 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'I should see correct doc/api directory rendered'
do
step
'I should see correct doc/api directory rendered'
do
current_path
.
should
==
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api"
)
expect
(
current_path
).
to
eq
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api"
)
page
.
should
have_content
"README.md"
expect
(
page
).
to
have_content
"README.md"
page
.
should
have_content
"users.md"
expect
(
page
).
to
have_content
"users.md"
end
end
step
'I click on Maintenance in README'
do
step
'I click on Maintenance in README'
do
...
@@ -62,41 +62,41 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -62,41 +62,41 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'I should see correct maintenance file rendered'
do
step
'I should see correct maintenance file rendered'
do
current_path
.
should
==
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/raketasks/maintenance.md"
)
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/raketasks/maintenance.md"
)
page
.
should
have_content
"bundle exec rake gitlab:env:info RAILS_ENV=production"
expect
(
page
).
to
have_content
"bundle exec rake gitlab:env:info RAILS_ENV=production"
end
end
step
'I click on link "empty" in the README'
do
step
'I click on link "empty" in the README'
do
within
(
'.readme-holder'
)
do
page
.
within
(
'.readme-holder'
)
do
click_link
"empty"
click_link
"empty"
end
end
end
end
step
'I click on link "id" in the README'
do
step
'I click on link "id" in the README'
do
within
(
'.readme-holder'
)
do
page
.
within
(
'.readme-holder'
)
do
click_link
"#id"
click_link
"#id"
end
end
end
end
step
'I navigate to the doc/api/README'
do
step
'I navigate to the doc/api/README'
do
within
'.tree-table'
do
page
.
within
'.tree-table'
do
click_link
"doc"
click_link
"doc"
end
end
within
'.tree-table'
do
page
.
within
'.tree-table'
do
click_link
"api"
click_link
"api"
end
end
within
'.tree-table'
do
page
.
within
'.tree-table'
do
click_link
"README.md"
click_link
"README.md"
end
end
end
end
step
'I see correct file rendered'
do
step
'I see correct file rendered'
do
current_path
.
should
==
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
page
.
should
have_content
"Contents"
expect
(
page
).
to
have_content
"Contents"
page
.
should
have_link
"Users"
expect
(
page
).
to
have_link
"Users"
page
.
should
have_link
"Rake tasks"
expect
(
page
).
to
have_link
"Rake tasks"
end
end
step
'I click on users in doc/api/README'
do
step
'I click on users in doc/api/README'
do
...
@@ -104,8 +104,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -104,8 +104,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'I should see the correct document file'
do
step
'I should see the correct document file'
do
current_path
.
should
==
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/users.md"
)
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/users.md"
)
page
.
should
have_content
"Get a list of users."
expect
(
page
).
to
have_content
"Get a list of users."
end
end
step
'I click on raketasks in doc/api/README'
do
step
'I click on raketasks in doc/api/README'
do
...
@@ -131,32 +131,32 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -131,32 +131,32 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'I should see files from repository in markdown branch'
do
step
'I should see files from repository in markdown branch'
do
current_path
.
should
==
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown"
)
expect
(
current_path
).
to
eq
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown"
)
page
.
should
have_content
"README.md"
expect
(
page
).
to
have_content
"README.md"
page
.
should
have_content
"CHANGELOG"
expect
(
page
).
to
have_content
"CHANGELOG"
end
end
step
'I see correct file rendered in markdown branch'
do
step
'I see correct file rendered in markdown branch'
do
current_path
.
should
==
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
page
.
should
have_content
"Contents"
expect
(
page
).
to
have_content
"Contents"
page
.
should
have_link
"Users"
expect
(
page
).
to
have_link
"Users"
page
.
should
have_link
"Rake tasks"
expect
(
page
).
to
have_link
"Rake tasks"
end
end
step
'I should see correct document rendered for markdown branch'
do
step
'I should see correct document rendered for markdown branch'
do
current_path
.
should
==
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
page
.
should
have_content
"All API requests require authentication"
expect
(
page
).
to
have_content
"All API requests require authentication"
end
end
step
'I should see correct directory rendered for markdown branch'
do
step
'I should see correct directory rendered for markdown branch'
do
current_path
.
should
==
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown/doc/raketasks"
)
expect
(
current_path
).
to
eq
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown/doc/raketasks"
)
page
.
should
have_content
"backup_restore.md"
expect
(
page
).
to
have_content
"backup_restore.md"
page
.
should
have_content
"maintenance.md"
expect
(
page
).
to
have_content
"maintenance.md"
end
end
step
'I should see the users document file in markdown branch'
do
step
'I should see the users document file in markdown branch'
do
current_path
.
should
==
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/users.md"
)
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/users.md"
)
page
.
should
have_content
"Get a list of users."
expect
(
page
).
to
have_content
"Get a list of users."
end
end
# Expected link contents
# Expected link contents
...
@@ -208,7 +208,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -208,7 +208,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step
'I go to wiki page'
do
step
'I go to wiki page'
do
click_link
"Wiki"
click_link
"Wiki"
current_path
.
should
==
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"home"
)
expect
(
current_path
).
to
eq
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"home"
)
end
end
step
'I add various links to the wiki page'
do
step
'I add various links to the wiki page'
do
...
@@ -218,8 +218,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -218,8 +218,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'Wiki page should have added links'
do
step
'Wiki page should have added links'
do
current_path
.
should
==
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"home"
)
expect
(
current_path
).
to
eq
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"home"
)
page
.
should
have_content
"test GitLab API doc Rake tasks"
expect
(
page
).
to
have_content
"test GitLab API doc Rake tasks"
end
end
step
'I add a header to the wiki page'
do
step
'I add a header to the wiki page'
do
...
@@ -237,13 +237,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -237,13 +237,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'I see new wiki page named test'
do
step
'I see new wiki page named test'
do
current_path
.
should
==
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"test"
)
expect
(
current_path
).
to
eq
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"test"
)
page
.
should
have_content
"Editing"
expect
(
page
).
to
have_content
"Editing"
end
end
When
'I go back to wiki page home'
do
When
'I go back to wiki page home'
do
visit
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"home"
)
visit
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"home"
)
current_path
.
should
==
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"home"
)
expect
(
current_path
).
to
eq
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"home"
)
end
end
step
'I click on GitLab API doc link'
do
step
'I click on GitLab API doc link'
do
...
@@ -251,8 +251,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -251,8 +251,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'I see Gitlab API document'
do
step
'I see Gitlab API document'
do
current_path
.
should
==
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"api"
)
expect
(
current_path
).
to
eq
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"api"
)
page
.
should
have_content
"Editing"
expect
(
page
).
to
have_content
"Editing"
end
end
step
'I click on Rake tasks link'
do
step
'I click on Rake tasks link'
do
...
@@ -260,13 +260,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -260,13 +260,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'I see Rake tasks directory'
do
step
'I see Rake tasks directory'
do
current_path
.
should
==
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"raketasks"
)
expect
(
current_path
).
to
eq
namespace_project_wiki_path
(
@project
.
namespace
,
@project
,
"raketasks"
)
page
.
should
have_content
"Editing"
expect
(
page
).
to
have_content
"Editing"
end
end
step
'I go directory which contains README file'
do
step
'I go directory which contains README file'
do
visit
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api"
)
visit
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api"
)
current_path
.
should
==
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api"
)
expect
(
current_path
).
to
eq
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api"
)
end
end
step
'I click on a relative link in README'
do
step
'I click on a relative link in README'
do
...
@@ -274,8 +274,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
...
@@ -274,8 +274,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
end
step
'I should see the correct markdown'
do
step
'I should see the correct markdown'
do
current_path
.
should
==
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/users.md"
)
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/users.md"
)
page
.
should
have_content
"List users"
expect
(
page
).
to
have_content
"List users"
end
end
step
'Header "Application details" should have correct id and link'
do
step
'Header "Application details" should have correct id and link'
do
...
...
features/steps/project/source/multiselect_blob.rb
View file @
8949758f
...
@@ -23,19 +23,19 @@ class Spinach::Features::ProjectSourceMultiselectBlob < Spinach::FeatureSteps
...
@@ -23,19 +23,19 @@ class Spinach::Features::ProjectSourceMultiselectBlob < Spinach::FeatureSteps
pluralization
=
range
.
kind_of?
(
Array
)
?
"s"
:
""
pluralization
=
range
.
kind_of?
(
Array
)
?
"s"
:
""
step
"I should see
\"
#{
fragment
}
\"
as URI fragment"
do
step
"I should see
\"
#{
fragment
}
\"
as URI fragment"
do
URI
.
parse
(
current_url
).
fragment
.
should
==
fragment
expect
(
URI
.
parse
(
current_url
).
fragment
).
to
eq
fragment
end
end
step
"I should see line
#{
pluralization
}
#{
fragment
[
1
..-
1
]
}
highlighted"
do
step
"I should see line
#{
pluralization
}
#{
fragment
[
1
..-
1
]
}
highlighted"
do
ids
=
Array
(
range
).
map
{
|
n
|
"LC
#{
n
}
"
}
ids
=
Array
(
range
).
map
{
|
n
|
"LC
#{
n
}
"
}
extra
=
false
extra
=
false
highlighted
=
all
(
"#tree-content-holder .highlight .line.hll"
)
highlighted
=
page
.
all
(
"#tree-content-holder .highlight .line.hll"
)
highlighted
.
each
do
|
element
|
highlighted
.
each
do
|
element
|
extra
||=
ids
.
delete
(
element
[
:id
]).
nil?
extra
||=
ids
.
delete
(
element
[
:id
]).
nil?
end
end
ex
tra
.
should
be_false
and
ids
.
should
be_empty
ex
pect
(
extra
).
to
be_false
and
ids
.
should
be_empty
end
end
end
end
end
end
...
...
features/steps/project/source/search_code.rb
View file @
8949758f
...
@@ -9,11 +9,11 @@ class Spinach::Features::ProjectSourceSearchCode < Spinach::FeatureSteps
...
@@ -9,11 +9,11 @@ class Spinach::Features::ProjectSourceSearchCode < Spinach::FeatureSteps
end
end
step
'I should see files from repository containing "coffee"'
do
step
'I should see files from repository containing "coffee"'
do
page
.
should
have_content
'coffee'
expect
(
page
).
to
have_content
'coffee'
page
.
should
have_content
'CONTRIBUTING.md'
expect
(
page
).
to
have_content
'CONTRIBUTING.md'
end
end
step
'I should see empty result'
do
step
'I should see empty result'
do
page
.
should
have_content
"We couldn't find any"
expect
(
page
).
to
have_content
"We couldn't find any"
end
end
end
end
features/steps/project/star.rb
View file @
8949758f
...
@@ -5,7 +5,7 @@ class Spinach::Features::ProjectStar < Spinach::FeatureSteps
...
@@ -5,7 +5,7 @@ class Spinach::Features::ProjectStar < Spinach::FeatureSteps
include
SharedUser
include
SharedUser
step
"The project has no stars"
do
step
"The project has no stars"
do
page
.
should_not
have_content
'.star-buttons'
expect
(
page
).
not_to
have_content
'.star-buttons'
end
end
step
"The project has 0 stars"
do
step
"The project has 0 stars"
do
...
@@ -26,7 +26,7 @@ class Spinach::Features::ProjectStar < Spinach::FeatureSteps
...
@@ -26,7 +26,7 @@ class Spinach::Features::ProjectStar < Spinach::FeatureSteps
end
end
step
'I redirected to sign in page'
do
step
'I redirected to sign in page'
do
current_path
.
should
==
new_user_session_path
expect
(
current_path
).
to
eq
new_user_session_path
end
end
protected
protected
...
...
features/steps/project/team_management.rb
View file @
8949758f
...
@@ -5,14 +5,14 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -5,14 +5,14 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
include
Select2Helper
include
Select2Helper
step
'I should be able to see myself in team'
do
step
'I should be able to see myself in team'
do
page
.
should
have_content
(
@user
.
name
)
expect
(
page
).
to
have_content
(
@user
.
name
)
page
.
should
have_content
(
@user
.
username
)
expect
(
page
).
to
have_content
(
@user
.
username
)
end
end
step
'I should see "Dmitriy" in team list'
do
step
'I should see "Dmitriy" in team list'
do
user
=
User
.
find_by
(
name:
"Dmitriy"
)
user
=
User
.
find_by
(
name:
"Dmitriy"
)
page
.
should
have_content
(
user
.
name
)
expect
(
page
).
to
have_content
(
user
.
name
)
page
.
should
have_content
(
user
.
username
)
expect
(
page
).
to
have_content
(
user
.
username
)
end
end
step
'I click link "Add members"'
do
step
'I click link "Add members"'
do
...
@@ -22,7 +22,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -22,7 +22,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
step
'I select "Mike" as "Reporter"'
do
step
'I select "Mike" as "Reporter"'
do
user
=
User
.
find_by
(
name:
"Mike"
)
user
=
User
.
find_by
(
name:
"Mike"
)
within
".users-project-form"
do
page
.
within
".users-project-form"
do
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
select
"Reporter"
,
from:
"access_level"
select
"Reporter"
,
from:
"access_level"
end
end
...
@@ -30,13 +30,13 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -30,13 +30,13 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
end
end
step
'I should see "Mike" in team list as "Reporter"'
do
step
'I should see "Mike" in team list as "Reporter"'
do
within
".access-reporter"
do
page
.
within
".access-reporter"
do
page
.
should
have_content
(
'Mike'
)
expect
(
page
).
to
have_content
(
'Mike'
)
end
end
end
end
step
'I select "sjobs@apple.com" as "Reporter"'
do
step
'I select "sjobs@apple.com" as "Reporter"'
do
within
".users-project-form"
do
page
.
within
".users-project-form"
do
select2
(
"sjobs@apple.com"
,
from:
"#user_ids"
,
multiple:
true
)
select2
(
"sjobs@apple.com"
,
from:
"#user_ids"
,
multiple:
true
)
select
"Reporter"
,
from:
"access_level"
select
"Reporter"
,
from:
"access_level"
end
end
...
@@ -44,16 +44,16 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -44,16 +44,16 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
end
end
step
'I should see "sjobs@apple.com" in team list as invited "Reporter"'
do
step
'I should see "sjobs@apple.com" in team list as invited "Reporter"'
do
within
".access-reporter"
do
page
.
within
".access-reporter"
do
page
.
should
have_content
(
'sjobs@apple.com'
)
expect
(
page
).
to
have_content
(
'sjobs@apple.com'
)
page
.
should
have_content
(
'invited'
)
expect
(
page
).
to
have_content
(
'invited'
)
page
.
should
have_content
(
'Reporter'
)
expect
(
page
).
to
have_content
(
'Reporter'
)
end
end
end
end
step
'I should see "Dmitriy" in team list as "Developer"'
do
step
'I should see "Dmitriy" in team list as "Developer"'
do
within
".access-developer"
do
page
.
within
".access-developer"
do
page
.
should
have_content
(
'Dmitriy'
)
expect
(
page
).
to
have_content
(
'Dmitriy'
)
end
end
end
end
...
@@ -61,7 +61,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -61,7 +61,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
project
=
Project
.
find_by
(
name:
"Shop"
)
project
=
Project
.
find_by
(
name:
"Shop"
)
user
=
User
.
find_by
(
name:
'Dmitriy'
)
user
=
User
.
find_by
(
name:
'Dmitriy'
)
project_member
=
project
.
project_members
.
find_by
(
user_id:
user
.
id
)
project_member
=
project
.
project_members
.
find_by
(
user_id:
user
.
id
)
within
"#project_member_
#{
project_member
.
id
}
"
do
page
.
within
"#project_member_
#{
project_member
.
id
}
"
do
click_button
"Edit access level"
click_button
"Edit access level"
select
"Reporter"
,
from:
"project_member_access_level"
select
"Reporter"
,
from:
"project_member_access_level"
click_button
"Save"
click_button
"Save"
...
@@ -69,8 +69,8 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -69,8 +69,8 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
end
end
step
'I should see "Dmitriy" in team list as "Reporter"'
do
step
'I should see "Dmitriy" in team list as "Reporter"'
do
within
".access-reporter"
do
page
.
within
".access-reporter"
do
page
.
should
have_content
(
'Dmitriy'
)
expect
(
page
).
to
have_content
(
'Dmitriy'
)
end
end
end
end
...
@@ -80,8 +80,8 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -80,8 +80,8 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
step
'I should not see "Dmitriy" in team list'
do
step
'I should not see "Dmitriy" in team list'
do
user
=
User
.
find_by
(
name:
"Dmitriy"
)
user
=
User
.
find_by
(
name:
"Dmitriy"
)
page
.
should_not
have_content
(
user
.
name
)
expect
(
page
).
not_to
have_content
(
user
.
name
)
page
.
should_not
have_content
(
user
.
username
)
expect
(
page
).
not_to
have_content
(
user
.
username
)
end
end
step
'gitlab user "Mike"'
do
step
'gitlab user "Mike"'
do
...
@@ -123,7 +123,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -123,7 +123,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
project
=
Project
.
find_by
(
name:
"Shop"
)
project
=
Project
.
find_by
(
name:
"Shop"
)
user
=
User
.
find_by
(
name:
'Dmitriy'
)
user
=
User
.
find_by
(
name:
'Dmitriy'
)
project_member
=
project
.
project_members
.
find_by
(
user_id:
user
.
id
)
project_member
=
project
.
project_members
.
find_by
(
user_id:
user
.
id
)
within
"#project_member_
#{
project_member
.
id
}
"
do
page
.
within
"#project_member_
#{
project_member
.
id
}
"
do
click_link
(
'Remove user from team'
)
click_link
(
'Remove user from team'
)
end
end
end
end
...
...
features/steps/project/wiki.rb
View file @
8949758f
...
@@ -6,13 +6,13 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
...
@@ -6,13 +6,13 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
include
WikiHelper
include
WikiHelper
step
'I click on the Cancel button'
do
step
'I click on the Cancel button'
do
within
(
:css
,
".form-actions"
)
do
page
.
within
(
:css
,
".form-actions"
)
do
click_on
"Cancel"
click_on
"Cancel"
end
end
end
end
step
'I should be redirected back to the Edit Home Wiki page'
do
step
'I should be redirected back to the Edit Home Wiki page'
do
current_path
.
should
==
namespace_project_wiki_path
(
project
.
namespace
,
project
,
:home
)
expect
(
current_path
).
to
eq
namespace_project_wiki_path
(
project
.
namespace
,
project
,
:home
)
end
end
step
'I create the Wiki Home page'
do
step
'I create the Wiki Home page'
do
...
@@ -21,11 +21,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
...
@@ -21,11 +21,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end
end
step
'I should see the newly created wiki page'
do
step
'I should see the newly created wiki page'
do
page
.
should
have_content
"Home"
expect
(
page
).
to
have_content
"Home"
page
.
should
have_content
"link test"
expect
(
page
).
to
have_content
"link test"
click_link
"link test"
click_link
"link test"
page
.
should
have_content
"Editing"
expect
(
page
).
to
have_content
"Editing"
end
end
step
'I have an existing Wiki page'
do
step
'I have an existing Wiki page'
do
...
@@ -47,11 +47,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
...
@@ -47,11 +47,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end
end
step
'I should see the updated content'
do
step
'I should see the updated content'
do
page
.
should
have_content
"Updated Wiki Content"
expect
(
page
).
to
have_content
"Updated Wiki Content"
end
end
step
'I should be redirected back to that Wiki page'
do
step
'I should be redirected back to that Wiki page'
do
current_path
.
should
==
namespace_project_wiki_path
(
project
.
namespace
,
project
,
@page
)
expect
(
current_path
).
to
eq
namespace_project_wiki_path
(
project
.
namespace
,
project
,
@page
)
end
end
step
'That page has two revisions'
do
step
'That page has two revisions'
do
...
@@ -63,9 +63,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
...
@@ -63,9 +63,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end
end
step
'I should see both revisions'
do
step
'I should see both revisions'
do
page
.
should
have_content
current_user
.
name
expect
(
page
).
to
have_content
current_user
.
name
page
.
should
have_content
"first commit"
expect
(
page
).
to
have_content
"first commit"
page
.
should
have_content
"second commit"
expect
(
page
).
to
have_content
"second commit"
end
end
step
'I click on the "Delete this page" button'
do
step
'I click on the "Delete this page" button'
do
...
@@ -73,7 +73,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
...
@@ -73,7 +73,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end
end
step
'The page should be deleted'
do
step
'The page should be deleted'
do
page
.
should
have_content
"Page was successfully deleted"
expect
(
page
).
to
have_content
"Page was successfully deleted"
end
end
step
'I click on the "Pages" button'
do
step
'I click on the "Pages" button'
do
...
@@ -81,8 +81,8 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
...
@@ -81,8 +81,8 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end
end
step
'I should see the existing page in the pages list'
do
step
'I should see the existing page in the pages list'
do
page
.
should
have_content
current_user
.
name
expect
(
page
).
to
have_content
current_user
.
name
page
.
should
have_content
@page
.
title
expect
(
page
).
to
have_content
@page
.
title
end
end
step
'I have an existing Wiki page with images linked on page'
do
step
'I have an existing Wiki page with images linked on page'
do
...
@@ -98,30 +98,30 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
...
@@ -98,30 +98,30 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
file
=
Gollum
::
File
.
new
(
wiki
.
wiki
)
file
=
Gollum
::
File
.
new
(
wiki
.
wiki
)
Gollum
::
Wiki
.
any_instance
.
stub
(
:file
).
with
(
"image.jpg"
,
"master"
,
true
).
and_return
(
file
)
Gollum
::
Wiki
.
any_instance
.
stub
(
:file
).
with
(
"image.jpg"
,
"master"
,
true
).
and_return
(
file
)
Gollum
::
File
.
any_instance
.
stub
(
:mime_type
).
and_return
(
"image/jpeg"
)
Gollum
::
File
.
any_instance
.
stub
(
:mime_type
).
and_return
(
"image/jpeg"
)
page
.
should
have_link
(
'image'
,
href:
"image.jpg"
)
expect
(
page
).
to
have_link
(
'image'
,
href:
"image.jpg"
)
click_on
"image"
click_on
"image"
end
end
step
'I should see the image from wiki repo'
do
step
'I should see the image from wiki repo'
do
current_path
.
should
match
(
'wikis/image.jpg'
)
expect
(
current_path
).
to
match
(
'wikis/image.jpg'
)
page
.
should_not
have_xpath
(
'/html'
)
# Page should render the image which means there is no html involved
expect
(
page
).
not_to
have_xpath
(
'/html'
)
# Page should render the image which means there is no html involved
Gollum
::
Wiki
.
any_instance
.
unstub
(
:file
)
Gollum
::
Wiki
.
any_instance
.
unstub
(
:file
)
Gollum
::
File
.
any_instance
.
unstub
(
:mime_type
)
Gollum
::
File
.
any_instance
.
unstub
(
:mime_type
)
end
end
step
'Image should be shown on the page'
do
step
'Image should be shown on the page'
do
page
.
should
have_xpath
(
"//img[@src=
\"
image.jpg
\"
]"
)
expect
(
page
).
to
have_xpath
(
"//img[@src=
\"
image.jpg
\"
]"
)
end
end
step
'I click on image link'
do
step
'I click on image link'
do
page
.
should
have_link
(
'image'
,
href:
"image.jpg"
)
expect
(
page
).
to
have_link
(
'image'
,
href:
"image.jpg"
)
click_on
"image"
click_on
"image"
end
end
step
'I should see the new wiki page form'
do
step
'I should see the new wiki page form'
do
current_path
.
should
match
(
'wikis/image.jpg'
)
expect
(
current_path
).
to
match
(
'wikis/image.jpg'
)
page
.
should
have_content
(
'New Wiki Page'
)
expect
(
page
).
to
have_content
(
'New Wiki Page'
)
page
.
should
have_content
(
'Editing - image.jpg'
)
expect
(
page
).
to
have_content
(
'Editing - image.jpg'
)
end
end
step
'I create a New page with paths'
do
step
'I create a New page with paths'
do
...
@@ -130,7 +130,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
...
@@ -130,7 +130,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
click_on
'Build'
click_on
'Build'
fill_in
"wiki_content"
,
with:
'wiki content'
fill_in
"wiki_content"
,
with:
'wiki content'
click_on
"Create page"
click_on
"Create page"
current_path
.
should
include
'one/two/three'
expect
(
current_path
).
to
include
'one/two/three'
end
end
step
'I create a New page with an invalid name'
do
step
'I create a New page with an invalid name'
do
...
@@ -144,7 +144,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
...
@@ -144,7 +144,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end
end
step
'I should see non-escaped link in the pages list'
do
step
'I should see non-escaped link in the pages list'
do
page
.
should
have_xpath
(
"//a[@href='/
#{
project
.
path_with_namespace
}
/wikis/one/two/three']"
)
expect
(
page
).
to
have_xpath
(
"//a[@href='/
#{
project
.
path_with_namespace
}
/wikis/one/two/three']"
)
end
end
step
'I edit the Wiki page with a path'
do
step
'I edit the Wiki page with a path'
do
...
@@ -153,11 +153,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
...
@@ -153,11 +153,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end
end
step
'I should see a non-escaped path'
do
step
'I should see a non-escaped path'
do
current_path
.
should
include
'one/two/three'
expect
(
current_path
).
to
include
'one/two/three'
end
end
step
'I should see the Editing page'
do
step
'I should see the Editing page'
do
page
.
should
have_content
(
'Editing'
)
expect
(
page
).
to
have_content
(
'Editing'
)
end
end
step
'I view the page history of a Wiki page that has a path'
do
step
'I view the page history of a Wiki page that has a path'
do
...
@@ -166,7 +166,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
...
@@ -166,7 +166,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end
end
step
'I should see the page history'
do
step
'I should see the page history'
do
page
.
should
have_content
(
'History for'
)
expect
(
page
).
to
have_content
(
'History for'
)
end
end
step
'I search for Wiki content'
do
step
'I search for Wiki content'
do
...
...
features/steps/search.rb
View file @
8949758f
...
@@ -24,35 +24,35 @@ class Spinach::Features::Search < Spinach::FeatureSteps
...
@@ -24,35 +24,35 @@ class Spinach::Features::Search < Spinach::FeatureSteps
end
end
step
'I click "Issues" link'
do
step
'I click "Issues" link'
do
within
'.search-filter'
do
page
.
within
'.search-filter'
do
click_link
'Issues'
click_link
'Issues'
end
end
end
end
step
'I click project "Shop" link'
do
step
'I click project "Shop" link'
do
within
'.project-filter'
do
page
.
within
'.project-filter'
do
click_link
project
.
name_with_namespace
click_link
project
.
name_with_namespace
end
end
end
end
step
'I click "Merge requests" link'
do
step
'I click "Merge requests" link'
do
within
'.search-filter'
do
page
.
within
'.search-filter'
do
click_link
'Merge requests'
click_link
'Merge requests'
end
end
end
end
step
'I click "Wiki" link'
do
step
'I click "Wiki" link'
do
within
'.search-filter'
do
page
.
within
'.search-filter'
do
click_link
'Wiki'
click_link
'Wiki'
end
end
end
end
step
'I should see "Shop" project link'
do
step
'I should see "Shop" project link'
do
page
.
should
have_link
"Shop"
expect
(
page
).
to
have_link
"Shop"
end
end
step
'I should see code results for project "Shop"'
do
step
'I should see code results for project "Shop"'
do
page
.
should
have_content
'Update capybara, rspec-rails, poltergeist to recent versions'
expect
(
page
).
to
have_content
'Update capybara, rspec-rails, poltergeist to recent versions'
end
end
step
'I search for "Contibuting"'
do
step
'I search for "Contibuting"'
do
...
@@ -71,15 +71,15 @@ class Spinach::Features::Search < Spinach::FeatureSteps
...
@@ -71,15 +71,15 @@ class Spinach::Features::Search < Spinach::FeatureSteps
end
end
step
'I should see "Foo" link in the search results'
do
step
'I should see "Foo" link in the search results'
do
find
(
:css
,
'.search-results'
).
should
have_link
'Foo'
expect
(
find
(
:css
,
'.search-results'
)).
to
have_link
'Foo'
end
end
step
'I should not see "Bar" link in the search results'
do
step
'I should not see "Bar" link in the search results'
do
find
(
:css
,
'.search-results'
).
should_not
have_link
'Bar'
expect
(
find
(
:css
,
'.search-results'
)).
not_to
have_link
'Bar'
end
end
step
'I should see "test_wiki" link in the search results'
do
step
'I should see "test_wiki" link in the search results'
do
find
(
:css
,
'.search-results'
).
should
have_link
'test_wiki.md'
expect
(
find
(
:css
,
'.search-results'
)).
to
have_link
'test_wiki.md'
end
end
step
'project has Wiki content'
do
step
'project has Wiki content'
do
...
...
features/steps/shared/active_tab.rb
View file @
8949758f
...
@@ -2,27 +2,27 @@ module SharedActiveTab
...
@@ -2,27 +2,27 @@ module SharedActiveTab
include
Spinach
::
DSL
include
Spinach
::
DSL
def
ensure_active_main_tab
(
content
)
def
ensure_active_main_tab
(
content
)
find
(
'.nav-sidebar > li.active'
).
should
have_content
(
content
)
expect
(
find
(
'.nav-sidebar > li.active'
)).
to
have_content
(
content
)
end
end
def
ensure_active_sub_tab
(
content
)
def
ensure_active_sub_tab
(
content
)
find
(
'div.content ul.nav-tabs li.active'
).
should
have_content
(
content
)
expect
(
find
(
'div.content ul.nav-tabs li.active'
)).
to
have_content
(
content
)
end
end
def
ensure_active_sub_nav
(
content
)
def
ensure_active_sub_nav
(
content
)
find
(
'.sidebar-subnav > li.active'
).
should
have_content
(
content
)
expect
(
find
(
'.sidebar-subnav > li.active'
)).
to
have_content
(
content
)
end
end
step
'no other main tabs should be active'
do
step
'no other main tabs should be active'
do
page
.
should
have_selector
(
'.nav-sidebar > li.active'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.nav-sidebar > li.active'
,
count:
1
)
end
end
step
'no other sub tabs should be active'
do
step
'no other sub tabs should be active'
do
page
.
should
have_selector
(
'div.content ul.nav-tabs li.active'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'div.content ul.nav-tabs li.active'
,
count:
1
)
end
end
step
'no other sub navs should be active'
do
step
'no other sub navs should be active'
do
page
.
should
have_selector
(
'.sidebar-subnav > li.active'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.sidebar-subnav > li.active'
,
count:
1
)
end
end
step
'the active main tab should be Home'
do
step
'the active main tab should be Home'
do
...
...
features/steps/shared/authentication.rb
View file @
8949758f
...
@@ -21,7 +21,7 @@ module SharedAuthentication
...
@@ -21,7 +21,7 @@ module SharedAuthentication
end
end
step
'I should be redirected to sign in page'
do
step
'I should be redirected to sign in page'
do
current_path
.
should
==
new_user_session_path
expect
(
current_path
).
to
eq
new_user_session_path
end
end
step
"I logout"
do
step
"I logout"
do
...
...
features/steps/shared/diff_note.rb
View file @
8949758f
...
@@ -3,7 +3,7 @@ module SharedDiffNote
...
@@ -3,7 +3,7 @@ module SharedDiffNote
include
RepoHelpers
include
RepoHelpers
step
'I cancel the diff comment'
do
step
'I cancel the diff comment'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
find
(
".js-close-discussion-note-form"
).
click
find
(
".js-close-discussion-note-form"
).
click
end
end
end
end
...
@@ -14,14 +14,14 @@ module SharedDiffNote
...
@@ -14,14 +14,14 @@ module SharedDiffNote
end
end
step
'I haven\'t written any diff comment text'
do
step
'I haven\'t written any diff comment text'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
fill_in
"note[note]"
,
with:
""
fill_in
"note[note]"
,
with:
""
end
end
end
end
step
'I leave a diff comment like "Typo, please fix"'
do
step
'I leave a diff comment like "Typo, please fix"'
do
click_diff_line
(
sample_commit
.
line_code
)
click_diff_line
(
sample_commit
.
line_code
)
within
(
"
#{
diff_file_selector
}
form[rel$='
#{
sample_commit
.
line_code
}
']"
)
do
page
.
within
(
"
#{
diff_file_selector
}
form[rel$='
#{
sample_commit
.
line_code
}
']"
)
do
fill_in
"note[note]"
,
with:
"Typo, please fix"
fill_in
"note[note]"
,
with:
"Typo, please fix"
find
(
".js-comment-button"
).
trigger
(
"click"
)
find
(
".js-comment-button"
).
trigger
(
"click"
)
sleep
0.05
sleep
0.05
...
@@ -30,7 +30,7 @@ module SharedDiffNote
...
@@ -30,7 +30,7 @@ module SharedDiffNote
step
'I preview a diff comment text like "Should fix it :smile:"'
do
step
'I preview a diff comment text like "Should fix it :smile:"'
do
click_diff_line
(
sample_commit
.
line_code
)
click_diff_line
(
sample_commit
.
line_code
)
within
(
"
#{
diff_file_selector
}
form[rel$='
#{
sample_commit
.
line_code
}
']"
)
do
page
.
within
(
"
#{
diff_file_selector
}
form[rel$='
#{
sample_commit
.
line_code
}
']"
)
do
fill_in
"note[note]"
,
with:
"Should fix it :smile:"
fill_in
"note[note]"
,
with:
"Should fix it :smile:"
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
end
end
...
@@ -39,7 +39,7 @@ module SharedDiffNote
...
@@ -39,7 +39,7 @@ module SharedDiffNote
step
'I preview another diff comment text like "DRY this up"'
do
step
'I preview another diff comment text like "DRY this up"'
do
click_diff_line
(
sample_commit
.
del_line_code
)
click_diff_line
(
sample_commit
.
del_line_code
)
within
(
"
#{
diff_file_selector
}
form[rel$='
#{
sample_commit
.
del_line_code
}
']"
)
do
page
.
within
(
"
#{
diff_file_selector
}
form[rel$='
#{
sample_commit
.
del_line_code
}
']"
)
do
fill_in
"note[note]"
,
with:
"DRY this up"
fill_in
"note[note]"
,
with:
"DRY this up"
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
end
end
...
@@ -54,103 +54,103 @@ module SharedDiffNote
...
@@ -54,103 +54,103 @@ module SharedDiffNote
end
end
step
'I write a diff comment like ":-1: I don\'t like this"'
do
step
'I write a diff comment like ":-1: I don\'t like this"'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
fill_in
"note[note]"
,
with:
":-1: I don
\'
t like this"
fill_in
"note[note]"
,
with:
":-1: I don
\'
t like this"
end
end
end
end
step
'I submit the diff comment'
do
step
'I submit the diff comment'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
click_button
(
"Add Comment"
)
click_button
(
"Add Comment"
)
end
end
end
end
step
'I should not see the diff comment form'
do
step
'I should not see the diff comment form'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
page
.
should_not
have_css
(
"form.new_note"
)
expect
(
page
).
not_to
have_css
(
"form.new_note"
)
end
end
end
end
step
'The diff comment preview tab should say there is nothing to do'
do
step
'The diff comment preview tab should say there is nothing to do'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
expect
(
find
(
'.js-md-preview'
)).
to
have_content
(
'Nothing to preview.'
)
expect
(
find
(
'.js-md-preview'
)).
to
have_content
(
'Nothing to preview.'
)
end
end
end
end
step
'I should not see the diff comment text field'
do
step
'I should not see the diff comment text field'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
expect
(
find
(
'.js-note-text'
)).
not_to
be_visible
expect
(
find
(
'.js-note-text'
)).
not_to
be_visible
end
end
end
end
step
'I should only see one diff form'
do
step
'I should only see one diff form'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
page
.
should
have_css
(
"form.new_note"
,
count:
1
)
expect
(
page
).
to
have_css
(
"form.new_note"
,
count:
1
)
end
end
end
end
step
'I should see a diff comment form with ":-1: I don\'t like this"'
do
step
'I should see a diff comment form with ":-1: I don\'t like this"'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
page
.
should
have_field
(
"note[note]"
,
with:
":-1: I don
\'
t like this"
)
expect
(
page
).
to
have_field
(
"note[note]"
,
with:
":-1: I don
\'
t like this"
)
end
end
end
end
step
'I should see a diff comment saying "Typo, please fix"'
do
step
'I should see a diff comment saying "Typo, please fix"'
do
within
(
"
#{
diff_file_selector
}
.note"
)
do
page
.
within
(
"
#{
diff_file_selector
}
.note"
)
do
page
.
should
have_content
(
"Typo, please fix"
)
expect
(
page
).
to
have_content
(
"Typo, please fix"
)
end
end
end
end
step
'I should see a discussion reply button'
do
step
'I should see a discussion reply button'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
page
.
should
have_button
(
'Reply'
)
expect
(
page
).
to
have_button
(
'Reply'
)
end
end
end
end
step
'I should see a temporary diff comment form'
do
step
'I should see a temporary diff comment form'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
page
.
should
have_css
(
".js-temp-notes-holder form.new_note"
)
expect
(
page
).
to
have_css
(
".js-temp-notes-holder form.new_note"
)
end
end
end
end
step
'I should see add a diff comment button'
do
step
'I should see add a diff comment button'
do
page
.
should
have_css
(
'.js-add-diff-note-button'
,
visible:
true
)
expect
(
page
).
to
have_css
(
'.js-add-diff-note-button'
,
visible:
true
)
end
end
step
'I should see an empty diff comment form'
do
step
'I should see an empty diff comment form'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
page
.
should
have_field
(
"note[note]"
,
with:
""
)
expect
(
page
).
to
have_field
(
"note[note]"
,
with:
""
)
end
end
end
end
step
'I should see the cancel comment button'
do
step
'I should see the cancel comment button'
do
within
(
"
#{
diff_file_selector
}
form"
)
do
page
.
within
(
"
#{
diff_file_selector
}
form"
)
do
page
.
should
have_css
(
".js-close-discussion-note-form"
,
text:
"Cancel"
)
expect
(
page
).
to
have_css
(
".js-close-discussion-note-form"
,
text:
"Cancel"
)
end
end
end
end
step
'I should see the diff comment preview'
do
step
'I should see the diff comment preview'
do
within
(
"
#{
diff_file_selector
}
form"
)
do
page
.
within
(
"
#{
diff_file_selector
}
form"
)
do
expect
(
page
).
to
have_css
(
'.js-md-preview'
,
visible:
true
)
expect
(
page
).
to
have_css
(
'.js-md-preview'
,
visible:
true
)
end
end
end
end
step
'I should see the diff comment write tab'
do
step
'I should see the diff comment write tab'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
expect
(
page
).
to
have_css
(
'.js-md-write-button'
,
visible:
true
)
expect
(
page
).
to
have_css
(
'.js-md-write-button'
,
visible:
true
)
end
end
end
end
step
'The diff comment preview tab should display rendered Markdown'
do
step
'The diff comment preview tab should display rendered Markdown'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
expect
(
find
(
'.js-md-preview'
)).
to
have_css
(
'img.emoji'
,
visible:
true
)
expect
(
find
(
'.js-md-preview'
)).
to
have_css
(
'img.emoji'
,
visible:
true
)
end
end
end
end
step
'I should see two separate previews'
do
step
'I should see two separate previews'
do
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
expect
(
page
).
to
have_css
(
'.js-md-preview'
,
visible:
true
,
count:
2
)
expect
(
page
).
to
have_css
(
'.js-md-preview'
,
visible:
true
,
count:
2
)
expect
(
page
).
to
have_content
(
'Should fix it'
)
expect
(
page
).
to
have_content
(
'Should fix it'
)
expect
(
page
).
to
have_content
(
'DRY this up'
)
expect
(
page
).
to
have_content
(
'DRY this up'
)
...
...
features/steps/shared/group.rb
View file @
8949758f
...
@@ -22,11 +22,11 @@ module SharedGroup
...
@@ -22,11 +22,11 @@ module SharedGroup
end
end
step
'I should see group "TestGroup"'
do
step
'I should see group "TestGroup"'
do
page
.
should
have_content
"TestGroup"
expect
(
page
).
to
have_content
"TestGroup"
end
end
step
'I should not see group "TestGroup"'
do
step
'I should not see group "TestGroup"'
do
page
.
should_not
have_content
"TestGroup"
expect
(
page
).
not_to
have_content
"TestGroup"
end
end
protected
protected
...
...
features/steps/shared/markdown.rb
View file @
8949758f
...
@@ -3,11 +3,11 @@ module SharedMarkdown
...
@@ -3,11 +3,11 @@ module SharedMarkdown
def
header_should_have_correct_id_and_link
(
level
,
text
,
id
,
parent
=
".wiki"
)
def
header_should_have_correct_id_and_link
(
level
,
text
,
id
,
parent
=
".wiki"
)
node
=
find
(
"
#{
parent
}
h
#{
level
}
a#
#{
id
}
"
)
node
=
find
(
"
#{
parent
}
h
#{
level
}
a#
#{
id
}
"
)
node
[
:href
].
should
==
"#
#{
id
}
"
expect
(
node
[
:href
]).
to
eq
"#
#{
id
}
"
# Work around a weird Capybara behavior where calling `parent` on a node
# Work around a weird Capybara behavior where calling `parent` on a node
# returns the whole document, not the node's actual parent element
# returns the whole document, not the node's actual parent element
find
(
:xpath
,
"
#{
node
.
path
}
/.."
).
text
.
should
==
text
expect
(
find
(
:xpath
,
"
#{
node
.
path
}
/.."
).
text
).
to
eq
text
end
end
step
'Header "Description header" should have correct id and link'
do
step
'Header "Description header" should have correct id and link'
do
...
@@ -19,7 +19,7 @@ module SharedMarkdown
...
@@ -19,7 +19,7 @@ module SharedMarkdown
end
end
step
'The Markdown preview tab should say there is nothing to do'
do
step
'The Markdown preview tab should say there is nothing to do'
do
within
(
'.gfm-form'
)
do
page
.
within
(
'.gfm-form'
)
do
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
expect
(
find
(
'.js-md-preview'
)).
to
have_content
(
'Nothing to preview.'
)
expect
(
find
(
'.js-md-preview'
)).
to
have_content
(
'Nothing to preview.'
)
end
end
...
@@ -38,7 +38,7 @@ module SharedMarkdown
...
@@ -38,7 +38,7 @@ module SharedMarkdown
end
end
step
'The Markdown preview tab should display rendered Markdown'
do
step
'The Markdown preview tab should display rendered Markdown'
do
within
(
'.gfm-form'
)
do
page
.
within
(
'.gfm-form'
)
do
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
expect
(
find
(
'.js-md-preview'
)).
to
have_css
(
'img.emoji'
,
visible:
true
)
expect
(
find
(
'.js-md-preview'
)).
to
have_css
(
'img.emoji'
,
visible:
true
)
end
end
...
@@ -49,7 +49,7 @@ module SharedMarkdown
...
@@ -49,7 +49,7 @@ module SharedMarkdown
end
end
step
'I preview a description text like "Bug fixed :smile:"'
do
step
'I preview a description text like "Bug fixed :smile:"'
do
within
(
'.gfm-form'
)
do
page
.
within
(
'.gfm-form'
)
do
fill_in
'Description'
,
with:
'Bug fixed :smile:'
fill_in
'Description'
,
with:
'Bug fixed :smile:'
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
end
end
...
...
features/steps/shared/note.rb
View file @
8949758f
...
@@ -7,13 +7,13 @@ module SharedNote
...
@@ -7,13 +7,13 @@ module SharedNote
end
end
step
'I haven\'t written any comment text'
do
step
'I haven\'t written any comment text'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
fill_in
"note[note]"
,
with:
""
fill_in
"note[note]"
,
with:
""
end
end
end
end
step
'I leave a comment like "XML attached"'
do
step
'I leave a comment like "XML attached"'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
fill_in
"note[note]"
,
with:
"XML attached"
fill_in
"note[note]"
,
with:
"XML attached"
click_button
"Add Comment"
click_button
"Add Comment"
sleep
0.05
sleep
0.05
...
@@ -21,94 +21,94 @@ module SharedNote
...
@@ -21,94 +21,94 @@ module SharedNote
end
end
step
'I preview a comment text like "Bug fixed :smile:"'
do
step
'I preview a comment text like "Bug fixed :smile:"'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
fill_in
"note[note]"
,
with:
"Bug fixed :smile:"
fill_in
"note[note]"
,
with:
"Bug fixed :smile:"
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
end
end
end
end
step
'I submit the comment'
do
step
'I submit the comment'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
click_button
"Add Comment"
click_button
"Add Comment"
end
end
end
end
step
'I write a comment like ":+1: Nice"'
do
step
'I write a comment like ":+1: Nice"'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
fill_in
'note[note]'
,
with:
':+1: Nice'
fill_in
'note[note]'
,
with:
':+1: Nice'
end
end
end
end
step
'I should not see a comment saying "XML attached"'
do
step
'I should not see a comment saying "XML attached"'
do
page
.
should_not
have_css
(
".note"
)
expect
(
page
).
not_to
have_css
(
".note"
)
end
end
step
'I should not see the cancel comment button'
do
step
'I should not see the cancel comment button'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
should_not
have_link
(
"Cancel"
)
should_not
have_link
(
"Cancel"
)
end
end
end
end
step
'I should not see the comment preview'
do
step
'I should not see the comment preview'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
expect
(
find
(
'.js-md-preview'
)).
not_to
be_visible
expect
(
find
(
'.js-md-preview'
)).
not_to
be_visible
end
end
end
end
step
'The comment preview tab should say there is nothing to do'
do
step
'The comment preview tab should say there is nothing to do'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
expect
(
find
(
'.js-md-preview'
)).
to
have_content
(
'Nothing to preview.'
)
expect
(
find
(
'.js-md-preview'
)).
to
have_content
(
'Nothing to preview.'
)
end
end
end
end
step
'I should not see the comment text field'
do
step
'I should not see the comment text field'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
expect
(
find
(
'.js-note-text'
)).
not_to
be_visible
expect
(
find
(
'.js-note-text'
)).
not_to
be_visible
end
end
end
end
step
'I should see a comment saying "XML attached"'
do
step
'I should see a comment saying "XML attached"'
do
within
(
".note"
)
do
page
.
within
(
".note"
)
do
page
.
should
have_content
(
"XML attached"
)
expect
(
page
).
to
have_content
(
"XML attached"
)
end
end
end
end
step
'I should see an empty comment text field'
do
step
'I should see an empty comment text field'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
page
.
should
have_field
(
"note[note]"
,
with:
""
)
expect
(
page
).
to
have_field
(
"note[note]"
,
with:
""
)
end
end
end
end
step
'I should see the comment write tab'
do
step
'I should see the comment write tab'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
expect
(
page
).
to
have_css
(
'.js-md-write-button'
,
visible:
true
)
expect
(
page
).
to
have_css
(
'.js-md-write-button'
,
visible:
true
)
end
end
end
end
step
'The comment preview tab should be display rendered Markdown'
do
step
'The comment preview tab should be display rendered Markdown'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
expect
(
find
(
'.js-md-preview'
)).
to
have_css
(
'img.emoji'
,
visible:
true
)
expect
(
find
(
'.js-md-preview'
)).
to
have_css
(
'img.emoji'
,
visible:
true
)
end
end
end
end
step
'I should see the comment preview'
do
step
'I should see the comment preview'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
expect
(
page
).
to
have_css
(
'.js-md-preview'
,
visible:
true
)
expect
(
page
).
to
have_css
(
'.js-md-preview'
,
visible:
true
)
end
end
end
end
step
'I should see comment "XML attached"'
do
step
'I should see comment "XML attached"'
do
within
(
".note"
)
do
page
.
within
(
".note"
)
do
page
.
should
have_content
(
"XML attached"
)
expect
(
page
).
to
have_content
(
"XML attached"
)
end
end
end
end
# Markdown
# Markdown
step
'I leave a comment with a header containing "Comment with a header"'
do
step
'I leave a comment with a header containing "Comment with a header"'
do
within
(
".js-main-target-form"
)
do
page
.
within
(
".js-main-target-form"
)
do
fill_in
"note[note]"
,
with:
"# Comment with a header"
fill_in
"note[note]"
,
with:
"# Comment with a header"
click_button
"Add Comment"
click_button
"Add Comment"
sleep
0.05
sleep
0.05
...
@@ -116,9 +116,9 @@ module SharedNote
...
@@ -116,9 +116,9 @@ module SharedNote
end
end
step
'The comment with the header should not have an ID'
do
step
'The comment with the header should not have an ID'
do
within
(
".note-body > .note-text"
)
do
page
.
within
(
".note-body > .note-text"
)
do
page
.
should
have_content
(
"Comment with a header"
)
expect
(
page
).
to
have_content
(
"Comment with a header"
)
page
.
should_not
have_css
(
"#comment-with-a-header"
)
expect
(
page
).
not_to
have_css
(
"#comment-with-a-header"
)
end
end
end
end
...
@@ -126,7 +126,7 @@ module SharedNote
...
@@ -126,7 +126,7 @@ module SharedNote
find
(
".note"
).
hover
find
(
".note"
).
hover
find
(
'.js-note-edit'
).
click
find
(
'.js-note-edit'
).
click
within
(
".current-note-edit-form"
)
do
page
.
within
(
".current-note-edit-form"
)
do
fill_in
'note[note]'
,
with:
'+1 Awesome!'
fill_in
'note[note]'
,
with:
'+1 Awesome!'
click_button
'Save Comment'
click_button
'Save Comment'
sleep
0.05
sleep
0.05
...
@@ -134,8 +134,8 @@ module SharedNote
...
@@ -134,8 +134,8 @@ module SharedNote
end
end
step
'I should see +1 in the description'
do
step
'I should see +1 in the description'
do
within
(
".note"
)
do
page
.
within
(
".note"
)
do
page
.
should
have_content
(
"+1 Awesome!"
)
expect
(
page
).
to
have_content
(
"+1 Awesome!"
)
end
end
end
end
end
end
features/steps/shared/paths.rb
View file @
8949758f
...
@@ -92,7 +92,7 @@ module SharedPaths
...
@@ -92,7 +92,7 @@ module SharedPaths
end
end
step
'I should be redirected to the dashboard groups page'
do
step
'I should be redirected to the dashboard groups page'
do
current_path
.
should
==
dashboard_groups_path
expect
(
current_path
).
to
eq
dashboard_groups_path
end
end
step
'I visit dashboard starred projects page'
do
step
'I visit dashboard starred projects page'
do
...
@@ -292,11 +292,11 @@ module SharedPaths
...
@@ -292,11 +292,11 @@ module SharedPaths
end
end
step
'I am on the new file page'
do
step
'I am on the new file page'
do
current_path
.
should
eq
(
namespace_project_create_blob_path
(
@project
.
namespace
,
@project
,
root_ref
))
expect
(
current_path
).
to
eq
(
namespace_project_create_blob_path
(
@project
.
namespace
,
@project
,
root_ref
))
end
end
step
'I am on the ".gitignore" edit file page'
do
step
'I am on the ".gitignore" edit file page'
do
current_path
.
should
eq
(
namespace_project_edit_blob_path
(
expect
(
current_path
).
to
eq
(
namespace_project_edit_blob_path
(
@project
.
namespace
,
@project
,
File
.
join
(
root_ref
,
'.gitignore'
)))
@project
.
namespace
,
@project
,
File
.
join
(
root_ref
,
'.gitignore'
)))
end
end
...
@@ -459,6 +459,6 @@ module SharedPaths
...
@@ -459,6 +459,6 @@ module SharedPaths
# ----------------------------------------
# ----------------------------------------
step
'page status code should be 404'
do
step
'page status code should be 404'
do
status_code
.
should
==
404
expect
(
status_code
).
to
eq
404
end
end
end
end
features/steps/shared/project.rb
View file @
8949758f
...
@@ -79,13 +79,13 @@ module SharedProject
...
@@ -79,13 +79,13 @@ module SharedProject
step
'I should see project "Shop" activity feed'
do
step
'I should see project "Shop" activity feed'
do
project
=
Project
.
find_by
(
name:
"Shop"
)
project
=
Project
.
find_by
(
name:
"Shop"
)
page
.
should
have_content
"
#{
@user
.
name
}
pushed new branch fix at
#{
project
.
name_with_namespace
}
"
expect
(
page
).
to
have_content
"
#{
@user
.
name
}
pushed new branch fix at
#{
project
.
name_with_namespace
}
"
end
end
step
'I should see project settings'
do
step
'I should see project settings'
do
current_path
.
should
==
edit_namespace_project_path
(
@project
.
namespace
,
@project
)
expect
(
current_path
).
to
eq
edit_namespace_project_path
(
@project
.
namespace
,
@project
)
page
.
should
have_content
(
"Project name"
)
expect
(
page
).
to
have_content
(
"Project name"
)
page
.
should
have_content
(
"Features:"
)
expect
(
page
).
to
have_content
(
"Features:"
)
end
end
def
current_project
def
current_project
...
@@ -101,11 +101,11 @@ module SharedProject
...
@@ -101,11 +101,11 @@ module SharedProject
end
end
step
'I should see project "Enterprise"'
do
step
'I should see project "Enterprise"'
do
page
.
should
have_content
"Enterprise"
expect
(
page
).
to
have_content
"Enterprise"
end
end
step
'I should not see project "Enterprise"'
do
step
'I should not see project "Enterprise"'
do
page
.
should_not
have_content
"Enterprise"
expect
(
page
).
not_to
have_content
"Enterprise"
end
end
step
'internal project "Internal"'
do
step
'internal project "Internal"'
do
...
@@ -113,11 +113,11 @@ module SharedProject
...
@@ -113,11 +113,11 @@ module SharedProject
end
end
step
'I should see project "Internal"'
do
step
'I should see project "Internal"'
do
page
.
should
have_content
"Internal"
expect
(
page
).
to
have_content
"Internal"
end
end
step
'I should not see project "Internal"'
do
step
'I should not see project "Internal"'
do
page
.
should_not
have_content
"Internal"
expect
(
page
).
not_to
have_content
"Internal"
end
end
step
'public project "Community"'
do
step
'public project "Community"'
do
...
@@ -125,11 +125,11 @@ module SharedProject
...
@@ -125,11 +125,11 @@ module SharedProject
end
end
step
'I should see project "Community"'
do
step
'I should see project "Community"'
do
page
.
should
have_content
"Community"
expect
(
page
).
to
have_content
"Community"
end
end
step
'I should not see project "Community"'
do
step
'I should not see project "Community"'
do
page
.
should_not
have_content
"Community"
expect
(
page
).
not_to
have_content
"Community"
end
end
step
'"John Doe" owns private project "Enterprise"'
do
step
'"John Doe" owns private project "Enterprise"'
do
...
...
features/steps/shared/project_tab.rb
View file @
8949758f
...
@@ -45,8 +45,8 @@ module SharedProjectTab
...
@@ -45,8 +45,8 @@ module SharedProjectTab
end
end
step
'the active main tab should be Settings'
do
step
'the active main tab should be Settings'
do
within
'.nav-sidebar'
do
page
.
within
'.nav-sidebar'
do
page
.
should
have_content
(
'Back to project'
)
expect
(
page
).
to
have_content
(
'Back to project'
)
end
end
end
end
end
end
features/steps/snippet_search.rb
View file @
8949758f
...
@@ -18,39 +18,39 @@ class Spinach::Features::SnippetSearch < Spinach::FeatureSteps
...
@@ -18,39 +18,39 @@ class Spinach::Features::SnippetSearch < Spinach::FeatureSteps
end
end
step
'I should see "line seven" in results'
do
step
'I should see "line seven" in results'
do
page
.
should
have_content
'line seven'
expect
(
page
).
to
have_content
'line seven'
end
end
step
'I should see "line four" in results'
do
step
'I should see "line four" in results'
do
page
.
should
have_content
'line four'
expect
(
page
).
to
have_content
'line four'
end
end
step
'I should see "line ten" in results'
do
step
'I should see "line ten" in results'
do
page
.
should
have_content
'line ten'
expect
(
page
).
to
have_content
'line ten'
end
end
step
'I should not see "line eleven" in results'
do
step
'I should not see "line eleven" in results'
do
page
.
should_not
have_content
'line eleven'
expect
(
page
).
not_to
have_content
'line eleven'
end
end
step
'I should not see "line three" in results'
do
step
'I should not see "line three" in results'
do
page
.
should_not
have_content
'line three'
expect
(
page
).
not_to
have_content
'line three'
end
end
step
'I should see "Personal snippet one" in results'
do
step
'I should see "Personal snippet one" in results'
do
page
.
should
have_content
'Personal snippet one'
expect
(
page
).
to
have_content
'Personal snippet one'
end
end
step
'I should see "Personal snippet private" in results'
do
step
'I should see "Personal snippet private" in results'
do
page
.
should
have_content
'Personal snippet private'
expect
(
page
).
to
have_content
'Personal snippet private'
end
end
step
'I should not see "Personal snippet one" in results'
do
step
'I should not see "Personal snippet one" in results'
do
page
.
should_not
have_content
'Personal snippet one'
expect
(
page
).
not_to
have_content
'Personal snippet one'
end
end
step
'I should not see "Personal snippet private" in results'
do
step
'I should not see "Personal snippet private" in results'
do
page
.
should_not
have_content
'Personal snippet private'
expect
(
page
).
not_to
have_content
'Personal snippet private'
end
end
end
end
features/steps/snippets/discover.rb
View file @
8949758f
...
@@ -4,15 +4,15 @@ class Spinach::Features::SnippetsDiscover < Spinach::FeatureSteps
...
@@ -4,15 +4,15 @@ class Spinach::Features::SnippetsDiscover < Spinach::FeatureSteps
include
SharedSnippet
include
SharedSnippet
step
'I should see "Personal snippet one" in snippets'
do
step
'I should see "Personal snippet one" in snippets'
do
page
.
should
have_content
"Personal snippet one"
expect
(
page
).
to
have_content
"Personal snippet one"
end
end
step
'I should see "Personal snippet internal" in snippets'
do
step
'I should see "Personal snippet internal" in snippets'
do
page
.
should
have_content
"Personal snippet internal"
expect
(
page
).
to
have_content
"Personal snippet internal"
end
end
step
'I should not see "Personal snippet private" in snippets'
do
step
'I should not see "Personal snippet private" in snippets'
do
page
.
should_not
have_content
"Personal snippet private"
expect
(
page
).
not_to
have_content
"Personal snippet private"
end
end
def
snippet
def
snippet
...
...
features/steps/snippets/public_snippets.rb
View file @
8949758f
...
@@ -4,11 +4,11 @@ class Spinach::Features::PublicSnippets < Spinach::FeatureSteps
...
@@ -4,11 +4,11 @@ class Spinach::Features::PublicSnippets < Spinach::FeatureSteps
include
SharedSnippet
include
SharedSnippet
step
'I should see snippet "Personal snippet one"'
do
step
'I should see snippet "Personal snippet one"'
do
page
.
should
have_no_xpath
(
"//i[@class='public-snippet']"
)
expect
(
page
).
to
have_no_xpath
(
"//i[@class='public-snippet']"
)
end
end
step
'I should see raw snippet "Personal snippet one"'
do
step
'I should see raw snippet "Personal snippet one"'
do
page
.
should
have_text
(
snippet
.
content
)
expect
(
page
).
to
have_text
(
snippet
.
content
)
end
end
step
'I visit snippet page "Personal snippet one"'
do
step
'I visit snippet page "Personal snippet one"'
do
...
...
features/steps/snippets/snippets.rb
View file @
8949758f
...
@@ -9,11 +9,11 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps
...
@@ -9,11 +9,11 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps
end
end
step
'I should not see "Personal snippet one" in snippets'
do
step
'I should not see "Personal snippet one" in snippets'
do
page
.
should_not
have_content
"Personal snippet one"
expect
(
page
).
not_to
have_content
"Personal snippet one"
end
end
step
'I click link "Edit"'
do
step
'I click link "Edit"'
do
within
".file-title"
do
page
.
within
".file-title"
do
click_link
"Edit"
click_link
"Edit"
end
end
end
end
...
@@ -25,15 +25,15 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps
...
@@ -25,15 +25,15 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps
step
'I submit new snippet "Personal snippet three"'
do
step
'I submit new snippet "Personal snippet three"'
do
fill_in
"personal_snippet_title"
,
:with
=>
"Personal snippet three"
fill_in
"personal_snippet_title"
,
:with
=>
"Personal snippet three"
fill_in
"personal_snippet_file_name"
,
:with
=>
"my_snippet.rb"
fill_in
"personal_snippet_file_name"
,
:with
=>
"my_snippet.rb"
within
(
'.file-editor'
)
do
page
.
within
(
'.file-editor'
)
do
find
(
:xpath
,
"//input[@id='personal_snippet_content']"
).
set
'Content of snippet three'
find
(
:xpath
,
"//input[@id='personal_snippet_content']"
).
set
'Content of snippet three'
end
end
click_button
"Create snippet"
click_button
"Create snippet"
end
end
step
'I should see snippet "Personal snippet three"'
do
step
'I should see snippet "Personal snippet three"'
do
page
.
should
have_content
"Personal snippet three"
expect
(
page
).
to
have_content
"Personal snippet three"
page
.
should
have_content
"Content of snippet three"
expect
(
page
).
to
have_content
"Content of snippet three"
end
end
step
'I submit new title "Personal snippet new title"'
do
step
'I submit new title "Personal snippet new title"'
do
...
@@ -42,7 +42,7 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps
...
@@ -42,7 +42,7 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps
end
end
step
'I should see "Personal snippet new title"'
do
step
'I should see "Personal snippet new title"'
do
page
.
should
have_content
"Personal snippet new title"
expect
(
page
).
to
have_content
"Personal snippet new title"
end
end
step
'I uncheck "Private" checkbox'
do
step
'I uncheck "Private" checkbox'
do
...
@@ -51,7 +51,7 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps
...
@@ -51,7 +51,7 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps
end
end
step
'I should see "Personal snippet one" public'
do
step
'I should see "Personal snippet one" public'
do
page
.
should
have_no_xpath
(
"//i[@class='public-snippet']"
)
expect
(
page
).
to
have_no_xpath
(
"//i[@class='public-snippet']"
)
end
end
step
'I visit snippet page "Personal snippet one"'
do
step
'I visit snippet page "Personal snippet one"'
do
...
...
features/steps/snippets/user.rb
View file @
8949758f
...
@@ -8,43 +8,43 @@ class Spinach::Features::SnippetsUser < Spinach::FeatureSteps
...
@@ -8,43 +8,43 @@ class Spinach::Features::SnippetsUser < Spinach::FeatureSteps
end
end
step
'I should see "Personal snippet one" in snippets'
do
step
'I should see "Personal snippet one" in snippets'
do
page
.
should
have_content
"Personal snippet one"
expect
(
page
).
to
have_content
"Personal snippet one"
end
end
step
'I should see "Personal snippet private" in snippets'
do
step
'I should see "Personal snippet private" in snippets'
do
page
.
should
have_content
"Personal snippet private"
expect
(
page
).
to
have_content
"Personal snippet private"
end
end
step
'I should see "Personal snippet internal" in snippets'
do
step
'I should see "Personal snippet internal" in snippets'
do
page
.
should
have_content
"Personal snippet internal"
expect
(
page
).
to
have_content
"Personal snippet internal"
end
end
step
'I should not see "Personal snippet one" in snippets'
do
step
'I should not see "Personal snippet one" in snippets'
do
page
.
should_not
have_content
"Personal snippet one"
expect
(
page
).
not_to
have_content
"Personal snippet one"
end
end
step
'I should not see "Personal snippet private" in snippets'
do
step
'I should not see "Personal snippet private" in snippets'
do
page
.
should_not
have_content
"Personal snippet private"
expect
(
page
).
not_to
have_content
"Personal snippet private"
end
end
step
'I should not see "Personal snippet internal" in snippets'
do
step
'I should not see "Personal snippet internal" in snippets'
do
page
.
should_not
have_content
"Personal snippet internal"
expect
(
page
).
not_to
have_content
"Personal snippet internal"
end
end
step
'I click "Internal" filter'
do
step
'I click "Internal" filter'
do
within
(
'.nav-tabs'
)
do
page
.
within
(
'.nav-tabs'
)
do
click_link
"Internal"
click_link
"Internal"
end
end
end
end
step
'I click "Private" filter'
do
step
'I click "Private" filter'
do
within
(
'.nav-tabs'
)
do
page
.
within
(
'.nav-tabs'
)
do
click_link
"Private"
click_link
"Private"
end
end
end
end
step
'I click "Public" filter'
do
step
'I click "Public" filter'
do
within
(
'.nav-tabs'
)
do
page
.
within
(
'.nav-tabs'
)
do
click_link
"Public"
click_link
"Public"
end
end
end
end
...
...
features/steps/user.rb
View file @
8949758f
...
@@ -28,13 +28,13 @@ class Spinach::Features::User < Spinach::FeatureSteps
...
@@ -28,13 +28,13 @@ class Spinach::Features::User < Spinach::FeatureSteps
end
end
step
'I should see contributed projects'
do
step
'I should see contributed projects'
do
within
'.contributed-projects'
do
page
.
within
'.contributed-projects'
do
page
.
should
have_content
(
@contributed_project
.
name
)
expect
(
page
).
to
have_content
(
@contributed_project
.
name
)
end
end
end
end
step
'I should see contributions calendar'
do
step
'I should see contributions calendar'
do
page
.
should
have_css
(
'.cal-heatmap-container'
)
expect
(
page
).
to
have_css
(
'.cal-heatmap-container'
)
end
end
def
contributed_project
def
contributed_project
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment