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:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-03 15:07:43 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-03 15:07:43 +0300
commit5dbbec4612d12d00d9db6ad057044054b923817f (patch)
tree08f392a1df5d84e8eccaf539968c884589517778 /features
parente8fc5591a2861b5c577b8f27d69912897077349b (diff)
parent18fa1550251655ce84a0886caaab7262fbeb9c51 (diff)
Merge pull request #8520 from cirosantilli/edit-blob-link-tests
Add tests for disabled blob edit button cases v2
Diffstat (limited to 'features')
-rw-r--r--features/project/source/browse_files.feature10
-rw-r--r--features/steps/project/source/browse_files.rb8
-rw-r--r--features/steps/shared/paths.rb10
3 files changed, 28 insertions, 0 deletions
diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature
index b7d70881d56..6ea64f70092 100644
--- a/features/project/source/browse_files.feature
+++ b/features/project/source/browse_files.feature
@@ -50,6 +50,16 @@ Feature: Project Source Browse Files
And I click button "Edit"
Then I can edit code
+ Scenario: If the file is binary the edit link is hidden
+ Given I visit a binary file in the repo
+ Then I cannot see the edit button
+
+ Scenario: If I don't have edit permission the edit link is disabled
+ Given public project "Community"
+ And I visit project "Community" source page
+ And I click on ".gitignore" file in repo
+ Then The edit button is disabled
+
@javascript
Scenario: I can edit and commit file
Given I click on ".gitignore" file in repo
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index ddd501d4f88..805e6ff0eac 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -48,6 +48,14 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
click_link 'Edit'
end
+ step 'I cannot see the edit button' do
+ page.should_not have_link 'edit'
+ end
+
+ step 'The edit button is disabled' do
+ page.should have_css '.disabled', text: 'Edit'
+ end
+
step 'I can edit code' do
set_new_content
evaluate_script('editor.getValue()').should == new_gitignore_content
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index b60d290ae9c..e657fceb704 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -183,6 +183,11 @@ module SharedPaths
visit project_tree_path(@project, root_ref)
end
+ step 'I visit a binary file in the repo' do
+ visit project_blob_path(@project, File.join(
+ root_ref, 'files/images/logo-black.png'))
+ end
+
step "I visit my project's commits page" do
visit project_commits_path(@project, root_ref, {limit: 5})
end
@@ -385,6 +390,11 @@ module SharedPaths
visit project_path(project)
end
+ step 'I visit project "Community" source page' do
+ project = Project.find_by(name: 'Community')
+ visit project_tree_path(project, root_ref)
+ end
+
step 'I visit project "Internal" page' do
project = Project.find_by(name: "Internal")
visit project_path(project)