Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2014-12-08 06:25:58 +0300
committerVinnie Okada <vokada@mrvinn.com>2014-12-08 06:25:58 +0300
commit742e6eeed221489d5f35bdfde2e6ce55db75d25f (patch)
tree710c01fbd18e81a7590819161434e19855e35a97 /features
parent7a5072c5a8f03cd7342a5f8e74e1fde0250ce360 (diff)
parentbbf9953b99d59801c72dd7b9550ee149ca77bfcf (diff)
Merge branch 'upstream-master' into markdown-preview
Conflicts: spec/routing/project_routing_spec.rb
Diffstat (limited to 'features')
-rw-r--r--features/admin/groups.feature7
-rw-r--r--features/profile/profile.feature19
-rw-r--r--features/project/active_tab.feature2
-rw-r--r--features/project/fork.feature2
-rw-r--r--features/project/service.feature12
-rw-r--r--features/project/source/browse_files.feature20
-rw-r--r--features/snippets/public_snippets.feature10
-rw-r--r--features/snippets/snippets.feature2
-rw-r--r--features/steps/admin/groups.rb23
-rw-r--r--features/steps/dashboard/event_filters.rb2
-rw-r--r--features/steps/dashboard/issues.rb10
-rw-r--r--features/steps/dashboard/merge_requests.rb46
-rw-r--r--features/steps/profile/profile.rb44
-rw-r--r--features/steps/project/active_tab.rb4
-rw-r--r--features/steps/project/fork.rb6
-rw-r--r--features/steps/project/issues/milestones.rb4
-rw-r--r--features/steps/project/project.rb2
-rw-r--r--features/steps/project/services.rb39
-rw-r--r--features/steps/project/source/browse_files.rb10
-rw-r--r--features/steps/shared/paths.rb9
-rw-r--r--features/steps/shared/project.rb4
-rw-r--r--features/steps/shared/snippet.rb9
-rw-r--r--features/steps/snippets/public_snippets.rb25
23 files changed, 286 insertions, 25 deletions
diff --git a/features/admin/groups.feature b/features/admin/groups.feature
index 1a465c1be55..aa365a6ea1a 100644
--- a/features/admin/groups.feature
+++ b/features/admin/groups.feature
@@ -20,3 +20,10 @@ Feature: Admin Groups
When I visit admin group page
When I select user "John Doe" from user list as "Reporter"
Then I should see "John Doe" in team list in every project as "Reporter"
+
+ @javascript
+ Scenario: Remove user from group
+ Given we have user "John Doe" in group
+ When I visit admin group page
+ And I remove user "John Doe" from group
+ Then I should not see "John Doe" in team list
diff --git a/features/profile/profile.feature b/features/profile/profile.feature
index d2125e013bc..d7fa370fe2a 100644
--- a/features/profile/profile.feature
+++ b/features/profile/profile.feature
@@ -83,3 +83,22 @@ Feature: Profile
Given I visit profile design page
When I change my code preview theme
Then I should receive feedback that the changes were saved
+
+ @javascript
+ Scenario: I see the password strength indicator
+ Given I visit profile password page
+ When I try to set a weak password
+ Then I should see the input field yellow
+
+ @javascript
+ Scenario: I see the password strength indicator error
+ Given I visit profile password page
+ When I try to set a short password
+ Then I should see the input field red
+ And I should see the password error message
+
+ @javascript
+ Scenario: I see the password strength indicator with success
+ Given I visit profile password page
+ When I try to set a strong password
+ Then I should see the input field green \ No newline at end of file
diff --git a/features/project/active_tab.feature b/features/project/active_tab.feature
index 8d3e0bd967f..ed548177837 100644
--- a/features/project/active_tab.feature
+++ b/features/project/active_tab.feature
@@ -110,7 +110,7 @@ Feature: Project Active Tab
Scenario: On Project Issues/Browse
Given I visit my project's issues page
- Then the active sub tab should be Browse Issues
+ Then the active sub tab should be Issues
And no other sub tabs should be active
And the active main tab should be Issues
diff --git a/features/project/fork.feature b/features/project/fork.feature
index d3d1180db04..22f68e5b340 100644
--- a/features/project/fork.feature
+++ b/features/project/fork.feature
@@ -6,9 +6,11 @@ Feature: Project Fork
Scenario: User fork a project
Given I click link "Fork"
+ When I fork to my namespace
Then I should see the forked project page
Scenario: User already has forked the project
Given I already have a project named "Shop" in my namespace
And I click link "Fork"
+ When I fork to my namespace
Then I should see a "Name has already been taken" warning
diff --git a/features/project/service.feature b/features/project/service.feature
index af88eaefa8f..ed9e03b428d 100644
--- a/features/project/service.feature
+++ b/features/project/service.feature
@@ -19,6 +19,12 @@ Feature: Project Services
And I fill hipchat settings
Then I should see hipchat service settings saved
+ Scenario: Activate hipchat service with custom server
+ When I visit project "Shop" services page
+ And I click hipchat service link
+ And I fill hipchat settings with custom server
+ Then I should see hipchat service settings with custom server saved
+
Scenario: Activate pivotaltracker service
When I visit project "Shop" services page
And I click pivotaltracker service link
@@ -54,3 +60,9 @@ Feature: Project Services
And I click email on push service link
And I fill email on push settings
Then I should see email on push service settings saved
+
+ Scenario: Activate Atlassian Bamboo CI service
+ When I visit project "Shop" services page
+ And I click Atlassian Bamboo CI service link
+ And I fill Atlassian Bamboo CI settings
+ Then I should see Atlassian Bamboo CI service settings saved
diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature
index aca255b9444..b7d70881d56 100644
--- a/features/project/source/browse_files.feature
+++ b/features/project/source/browse_files.feature
@@ -35,6 +35,16 @@ Feature: Project Source Browse Files
And I should see its new content
@javascript
+ Scenario: If I enter an illegal file name I see an error message
+ Given I click on "new file" link in repo
+ And I fill the new file name with an illegal name
+ And I edit code
+ And I fill the commit message
+ And I click on "Commit changes"
+ Then I am on the new file page
+ And I see a commit error message
+
+ @javascript
Scenario: I can edit file
Given I click on ".gitignore" file in repo
And I click button "Edit"
@@ -50,6 +60,16 @@ Feature: Project Source Browse Files
Then I am redirected to the ".gitignore"
And I should see its new content
+ @javascript @wip
+ Scenario: If I don't change the content of the file I see an error message
+ Given I click on ".gitignore" file in repo
+ And I click button "edit"
+ And I fill the commit message
+ And I click on "Commit changes"
+ # Test fails because carriage returns are added to the file.
+ Then I am on the ".gitignore" edit file page
+ And I see a commit error message
+
@javascript
Scenario: I can see editing preview
Given I click on ".gitignore" file in repo
diff --git a/features/snippets/public_snippets.feature b/features/snippets/public_snippets.feature
new file mode 100644
index 00000000000..c2afb63b6d8
--- /dev/null
+++ b/features/snippets/public_snippets.feature
@@ -0,0 +1,10 @@
+Feature: Public snippets
+ Scenario: Unauthenticated user should see public snippets
+ Given There is public "Personal snippet one" snippet
+ And I visit snippet page "Personal snippet one"
+ Then I should see snippet "Personal snippet one"
+
+ Scenario: Unauthenticated user should see raw public snippets
+ Given There is public "Personal snippet one" snippet
+ And I visit snippet raw page "Personal snippet one"
+ Then I should see raw snippet "Personal snippet one"
diff --git a/features/snippets/snippets.feature b/features/snippets/snippets.feature
index 4c4e3ee2cff..6e8019c326f 100644
--- a/features/snippets/snippets.feature
+++ b/features/snippets/snippets.feature
@@ -25,4 +25,4 @@ Feature: Snippets
Scenario: I destroy "Personal snippet one"
Given I visit snippet page "Personal snippet one"
And I click link "Destroy"
- Then I should not see "Personal snippet one" in snippets
+ Then I should not see "Personal snippet one" in snippets \ No newline at end of file
diff --git a/features/steps/admin/groups.rb b/features/steps/admin/groups.rb
index 4f0ba05606d..d69a87cd07e 100644
--- a/features/steps/admin/groups.rb
+++ b/features/steps/admin/groups.rb
@@ -37,8 +37,7 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
end
When 'I select user "John Doe" from user list as "Reporter"' do
- user = User.find_by(name: "John Doe")
- select2(user.id, from: "#user_ids", multiple: true)
+ select2(user_john.id, from: "#user_ids", multiple: true)
within "#new_team_member" do
select "Reporter", from: "access_level"
end
@@ -58,9 +57,29 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
end
end
+ step 'we have user "John Doe" in group' do
+ current_group.add_user(user_john, Gitlab::Access::REPORTER)
+ end
+
+ step 'I remove user "John Doe" from group' do
+ within "#user_#{user_john.id}" do
+ click_link 'Remove user from group'
+ end
+ end
+
+ step 'I should not see "John Doe" in team list' do
+ within ".group-users-list" do
+ page.should_not have_content "John Doe"
+ end
+ end
+
protected
def current_group
@group ||= Group.first
end
+
+ def user_john
+ @user_john ||= User.find_by(name: "John Doe")
+ end
end
diff --git a/features/steps/dashboard/event_filters.rb b/features/steps/dashboard/event_filters.rb
index 332bfa95d97..3da3d62d0c0 100644
--- a/features/steps/dashboard/event_filters.rb
+++ b/features/steps/dashboard/event_filters.rb
@@ -29,7 +29,7 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps
step 'this project has push event' do
data = {
- before: "0000000000000000000000000000000000000000",
+ before: Gitlab::Git::BLANK_SHA,
after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
ref: "refs/heads/new_design",
user_id: @user.id,
diff --git a/features/steps/dashboard/issues.rb b/features/steps/dashboard/issues.rb
index 6b5f88e5895..2a5850d091b 100644
--- a/features/steps/dashboard/issues.rb
+++ b/features/steps/dashboard/issues.rb
@@ -10,6 +10,7 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
step 'I should see issues authored by me' do
should_see(authored_issue)
+ should_see(authored_issue_on_public_project)
should_not_see(assigned_issue)
should_not_see(other_issue)
end
@@ -22,6 +23,7 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
step 'I have authored issues' do
authored_issue
+ authored_issue_on_public_project
end
step 'I have assigned issues' do
@@ -64,6 +66,10 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
@other_issue ||= create :issue, project: project
end
+ def authored_issue_on_public_project
+ @authored_issue_on_public_project ||= create :issue, author: current_user, project: public_project
+ end
+
def project
@project ||= begin
project =create :project
@@ -71,4 +77,8 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
project
end
end
+
+ def public_project
+ @public_project ||= create :project, :public
+ end
end
diff --git a/features/steps/dashboard/merge_requests.rb b/features/steps/dashboard/merge_requests.rb
index 95c378fa201..75e53173d3f 100644
--- a/features/steps/dashboard/merge_requests.rb
+++ b/features/steps/dashboard/merge_requests.rb
@@ -4,13 +4,17 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
step 'I should see merge requests assigned to me' do
should_see(assigned_merge_request)
+ should_see(assigned_merge_request_from_fork)
should_not_see(authored_merge_request)
+ should_not_see(authored_merge_request_from_fork)
should_not_see(other_merge_request)
end
step 'I should see merge requests authored by me' do
should_see(authored_merge_request)
+ should_see(authored_merge_request_from_fork)
should_not_see(assigned_merge_request)
+ should_not_see(assigned_merge_request_from_fork)
should_not_see(other_merge_request)
end
@@ -22,10 +26,12 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
step 'I have authored merge requests' do
authored_merge_request
+ authored_merge_request_from_fork
end
step 'I have assigned merge requests' do
assigned_merge_request
+ assigned_merge_request_from_fork
end
step 'I have other merge requests' do
@@ -53,15 +59,41 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
end
def assigned_merge_request
- @assigned_merge_request ||= create :merge_request, assignee: current_user, target_project: project, source_project: project
+ @assigned_merge_request ||= create :merge_request,
+ assignee: current_user,
+ target_project: project,
+ source_project: project
end
def authored_merge_request
- @authored_merge_request ||= create :merge_request, source_branch: 'simple_merge_request', author: current_user, target_project: project, source_project: project
+ @authored_merge_request ||= create :merge_request,
+ source_branch: 'simple_merge_request',
+ author: current_user,
+ target_project: project,
+ source_project: project
end
def other_merge_request
- @other_merge_request ||= create :merge_request, source_branch: '2_3_notes_fix', target_project: project, source_project: project
+ @other_merge_request ||= create :merge_request,
+ source_branch: '2_3_notes_fix',
+ target_project: project,
+ source_project: project
+ end
+
+ def authored_merge_request_from_fork
+ @authored_merge_request_from_fork ||= create :merge_request,
+ source_branch: 'basic_page',
+ author: current_user,
+ target_project: public_project,
+ source_project: forked_project
+ end
+
+ def assigned_merge_request_from_fork
+ @assigned_merge_request_from_fork ||= create :merge_request,
+ source_branch: 'basic_page_fix',
+ assignee: current_user,
+ target_project: public_project,
+ source_project: forked_project
end
def project
@@ -71,4 +103,12 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
project
end
end
+
+ def public_project
+ @public_project ||= create :project, :public
+ end
+
+ def forked_project
+ @forked_project ||= Projects::ForkService.new(public_project, current_user).execute
+ end
end
diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb
index adfaefb1644..38aaadcd28d 100644
--- a/features/steps/profile/profile.rb
+++ b/features/steps/profile/profile.rb
@@ -58,16 +58,34 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
step 'I try change my password w/o old one' do
within '.update-password' do
- fill_in "user_password", with: "22233344"
+ fill_in "user_password_profile", with: "22233344"
fill_in "user_password_confirmation", with: "22233344"
click_button "Save"
end
end
+ step 'I try to set a weak password' do
+ within '.update-password' do
+ fill_in "user_password_profile", with: "22233344"
+ end
+ end
+
+ step 'I try to set a short password' do
+ within '.update-password' do
+ fill_in "user_password_profile", with: "short"
+ end
+ end
+
+ step 'I try to set a strong password' do
+ within '.update-password' do
+ fill_in "user_password_profile", with: "Itulvo9z8uud%$"
+ end
+ end
+
step 'I change my password' do
within '.update-password' do
fill_in "user_current_password", with: "12345678"
- fill_in "user_password", with: "22233344"
+ fill_in "user_password_profile", with: "22233344"
fill_in "user_password_confirmation", with: "22233344"
click_button "Save"
end
@@ -76,7 +94,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
step 'I unsuccessfully change my password' do
within '.update-password' do
fill_in "user_current_password", with: "12345678"
- fill_in "user_password", with: "password"
+ fill_in "user_password_profile", with: "password"
fill_in "user_password_confirmation", with: "confirmation"
click_button "Save"
end
@@ -86,6 +104,22 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
page.should have_content "You must provide a valid current password"
end
+ step 'I should see the input field yellow' do
+ page.should have_css 'div.has-warning'
+ end
+
+ step 'I should see the input field green' do
+ page.should have_css 'div.has-success'
+ end
+
+ step 'I should see the input field red' do
+ page.should have_css 'div.has-error'
+ end
+
+ step 'I should see the password error message' do
+ page.should have_content 'Your password is too short'
+ end
+
step "I should see a password error message" do
page.should have_content "Password confirmation doesn't match"
end
@@ -136,7 +170,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
step "I am not an ldap user" do
- current_user.update_attributes(extern_uid: nil, provider: '')
+ current_user.identities.delete
current_user.ldap_user?.should be_false
end
@@ -146,7 +180,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
step 'I submit new password' do
fill_in :user_current_password, with: '12345678'
- fill_in :user_password, with: '12345678'
+ fill_in :user_password_profile, with: '12345678'
fill_in :user_password_confirmation, with: '12345678'
click_button "Set new password"
end
diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb
index 83796b0ba88..bb42d15eae5 100644
--- a/features/steps/project/active_tab.rb
+++ b/features/steps/project/active_tab.rb
@@ -89,8 +89,8 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
click_link('Labels')
end
- step 'the active sub tab should be Browse Issues' do
- ensure_active_sub_tab('Browse Issues')
+ step 'the active sub tab should be Issues' do
+ ensure_active_sub_tab('Issues')
end
step 'the active sub tab should be Milestones' do
diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb
index da50ba9ced0..8e58597db20 100644
--- a/features/steps/project/fork.rb
+++ b/features/steps/project/fork.rb
@@ -25,4 +25,10 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
step 'I should see a "Name has already been taken" warning' do
page.should have_content "Name has already been taken"
end
+
+ step 'I fork to my namespace' do
+ within '.fork-namespaces' do
+ click_link current_user.name
+ end
+ end
end
diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb
index 89d7af3c9ee..cce87a6d981 100644
--- a/features/steps/project/issues/milestones.rb
+++ b/features/steps/project/issues/milestones.rb
@@ -8,7 +8,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
milestone = @project.milestones.find_by(title: "v2.2")
page.should have_content(milestone.title[0..10])
page.should have_content(milestone.expires_at)
- page.should have_content("Browse Issues")
+ page.should have_content("Issues")
end
step 'I click link "v2.2"' do
@@ -28,7 +28,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
milestone = @project.milestones.find_by(title: "v2.3")
page.should have_content(milestone.title[0..10])
page.should have_content(milestone.expires_at)
- page.should have_content("Browse Issues")
+ page.should have_content("Issues")
end
step 'project "Shop" has milestone "v2.2"' do
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
index f7fff8e64f9..5e7312d90ff 100644
--- a/features/steps/project/project.rb
+++ b/features/steps/project/project.rb
@@ -4,7 +4,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
include SharedPaths
step 'change project settings' do
- fill_in 'project_name', with: 'NewName'
+ fill_in 'project_name_edit', with: 'NewName'
uncheck 'project_issues_enabled'
end
diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb
index 5bd60f99c84..7a0b47a8fe5 100644
--- a/features/steps/project/services.rb
+++ b/features/steps/project/services.rb
@@ -10,10 +10,11 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
step 'I should see list of available services' do
page.should have_content 'Project services'
page.should have_content 'Campfire'
- page.should have_content 'Hipchat'
+ page.should have_content 'HipChat'
page.should have_content 'GitLab CI'
page.should have_content 'Assembla'
page.should have_content 'Pushover'
+ page.should have_content 'Atlassian Bamboo'
end
step 'I click gitlab-ci service link' do
@@ -32,7 +33,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
end
step 'I click hipchat service link' do
- click_link 'Hipchat'
+ click_link 'HipChat'
end
step 'I fill hipchat settings' do
@@ -46,6 +47,17 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
find_field('Room').value.should == 'gitlab'
end
+ step 'I fill hipchat settings with custom server' do
+ check 'Active'
+ fill_in 'Room', with: 'gitlab_custom'
+ fill_in 'Token', with: 'secretCustom'
+ fill_in 'Server', with: 'https://chat.example.com'
+ click_button 'Save'
+ end
+
+ step 'I should see hipchat service settings with custom server saved' do
+ find_field('Server').value.should == 'https://chat.example.com'
+ end
step 'I click pivotaltracker service link' do
click_link 'PivotalTracker'
@@ -108,12 +120,12 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
step 'I fill Slack settings' do
check 'Active'
- fill_in 'Webhook', with: 'https://gitlabhq.slack.com/services/hooks?token=cdIj4r4LfXUOySDUjp0tk3OI'
+ fill_in 'Webhook', with: 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685'
click_button 'Save'
end
step 'I should see Slack service settings saved' do
- find_field('Webhook').value.should == 'https://gitlabhq.slack.com/services/hooks?token=cdIj4r4LfXUOySDUjp0tk3OI'
+ find_field('Webhook').value.should == 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685'
end
step 'I click Pushover service link' do
@@ -137,4 +149,23 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
find_field('Priority').find('option[selected]').value.should == '1'
find_field('Sound').find('option[selected]').value.should == 'bike'
end
+
+ step 'I click Atlassian Bamboo CI service link' do
+ click_link 'Atlassian Bamboo CI'
+ end
+
+ step 'I fill Atlassian Bamboo CI settings' do
+ check 'Active'
+ fill_in 'Bamboo url', with: 'http://bamboo.example.com'
+ fill_in 'Build key', with: 'KEY'
+ fill_in 'Username', with: 'user'
+ fill_in 'Password', with: 'verySecret'
+ click_button 'Save'
+ end
+
+ step 'I should see Atlassian Bamboo CI service settings saved' do
+ find_field('Bamboo url').value.should == 'http://bamboo.example.com'
+ find_field('Build key').value.should == 'KEY'
+ find_field('Username').value.should == 'user'
+ end
end
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index 20f8f6c24ae..ddd501d4f88 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -61,6 +61,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
fill_in :file_name, with: new_file_name
end
+ step 'I fill the new file name with an illegal name' do
+ fill_in :file_name, with: '.git'
+ end
+
step 'I fill the commit message' do
fill_in :commit_message, with: 'Not yet a commit message.'
end
@@ -74,7 +78,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I click on "Remove"' do
- click_link 'Remove'
+ click_button 'Remove'
end
step 'I click on "Remove file"' do
@@ -151,6 +155,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
expect(page).not_to have_link('permalink')
end
+ step 'I see a commit error message' do
+ expect(page).to have_content('Your changes could not be committed')
+ end
+
private
def set_new_content
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index 1f238f8befd..5f292255ce1 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -265,6 +265,15 @@ module SharedPaths
visit project_blob_path(@project, File.join(root_ref, '.gitignore'))
end
+ step 'I am on the new file page' do
+ current_path.should eq(project_new_tree_path(@project, root_ref))
+ end
+
+ step 'I am on the ".gitignore" edit file page' do
+ current_path.should eq(project_edit_tree_path(
+ @project, File.join(root_ref, '.gitignore')))
+ end
+
step 'I visit project source page for "6d39438"' do
visit project_tree_path(@project, "6d39438")
end
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index 4b833850a1c..0bd5653538c 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -32,7 +32,7 @@ module SharedProject
@project = Project.find_by(name: "Shop")
data = {
- before: "0000000000000000000000000000000000000000",
+ before: Gitlab::Git::BLANK_SHA,
after: "6d394385cf567f80a8fd85055db1ab4c5295806f",
ref: "refs/heads/fix",
user_id: @user.id,
@@ -131,7 +131,7 @@ module SharedProject
end
step 'public empty project "Empty Public Project"' do
- create :empty_project, :public, name: "Empty Public Project"
+ create :project_empty_repo, :public, name: "Empty Public Project"
end
step 'project "Community" has comments' do
diff --git a/features/steps/shared/snippet.rb b/features/steps/shared/snippet.rb
index 432f32defce..bb596c1620a 100644
--- a/features/steps/shared/snippet.rb
+++ b/features/steps/shared/snippet.rb
@@ -51,4 +51,13 @@ module SharedSnippet
visibility_level: Snippet::PUBLIC,
author: current_user)
end
+
+ step 'There is public "Personal snippet one" snippet' do
+ create(:personal_snippet,
+ title: "Personal snippet one",
+ content: "Test content",
+ file_name: "snippet.rb",
+ visibility_level: Snippet::PUBLIC,
+ author: create(:user))
+ end
end
diff --git a/features/steps/snippets/public_snippets.rb b/features/steps/snippets/public_snippets.rb
new file mode 100644
index 00000000000..67669dc0a69
--- /dev/null
+++ b/features/steps/snippets/public_snippets.rb
@@ -0,0 +1,25 @@
+class Spinach::Features::PublicSnippets < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedSnippet
+
+ step 'I should see snippet "Personal snippet one"' do
+ page.should have_no_xpath("//i[@class='public-snippet']")
+ end
+
+ step 'I should see raw snippet "Personal snippet one"' do
+ page.should have_text(snippet.content)
+ end
+
+ step 'I visit snippet page "Personal snippet one"' do
+ visit snippet_path(snippet)
+ end
+
+ step 'I visit snippet raw page "Personal snippet one"' do
+ visit raw_snippet_path(snippet)
+ end
+
+ def snippet
+ @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one")
+ end
+end