summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2015-01-26 22:12:53 -0800
committerMarin Jankovski <maxlazio@gmail.com>2015-01-26 22:12:53 -0800
commit0da59cb55bfc8b6bb50f45d0ccdb19edc8b0a6e9 (patch)
tree52a372f621a96f5261f926968141313f29cf6da3 /features
parent33913f9b8fef1f8df45dc26239faf8fa4cffc982 (diff)
parente6b97d09470b01b5b65e87dab339c500f1bac45f (diff)
downloadgitlab-ce-0da59cb55bfc8b6bb50f45d0ccdb19edc8b0a6e9.tar.gz
Merge branch 'master' into move_external_issue_tracker_away_from_yml_config
Conflicts: app/models/project.rb spec/models/project_spec.rb
Diffstat (limited to 'features')
-rw-r--r--features/project/project.feature13
-rw-r--r--features/steps/project/project.rb57
-rw-r--r--features/steps/project/source/browse_files.rb2
-rw-r--r--features/steps/shared/paths.rb4
4 files changed, 65 insertions, 11 deletions
diff --git a/features/project/project.feature b/features/project/project.feature
index 7bb24e013a9..3e1fd54bee8 100644
--- a/features/project/project.feature
+++ b/features/project/project.feature
@@ -5,6 +5,19 @@ Feature: Project
And project "Shop" has push event
And I visit project "Shop" page
+ Scenario: I edit the project avatar
+ Given I visit edit project "Shop" page
+ When I change the project avatar
+ And I should see new project avatar
+ And I should see the "Remove avatar" button
+
+ Scenario: I remove the project avatar
+ Given I visit edit project "Shop" page
+ And I have an project avatar
+ When I remove my project avatar
+ Then I should see the default project avatar
+ And I should not see the "Remove avatar" button
+
@javascript
Scenario: I should see project activity
When I visit project "Shop" page
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
index 5e7312d90ff..033d45e0253 100644
--- a/features/steps/project/project.rb
+++ b/features/steps/project/project.rb
@@ -17,17 +17,58 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
step 'change project path settings' do
- fill_in "project_path", with: "new-path"
- click_button "Rename"
+ fill_in 'project_path', with: 'new-path'
+ click_button 'Rename'
end
step 'I should see project with new path settings' do
- project.path.should == "new-path"
+ project.path.should == 'new-path'
+ end
+
+ step 'I change the project avatar' do
+ attach_file(
+ :project_avatar,
+ File.join(Rails.root, 'public', 'gitlab_logo.png')
+ )
+ click_button 'Save changes'
+ @project.reload
+ end
+
+ step 'I should see new project avatar' do
+ @project.avatar.should be_instance_of AttachmentUploader
+ url = @project.avatar.url
+ url.should == "/uploads/project/avatar/#{ @project.id }/gitlab_logo.png"
+ end
+
+ step 'I should see the "Remove avatar" button' do
+ page.should have_link('Remove avatar')
+ end
+
+ step 'I have an project avatar' do
+ attach_file(
+ :project_avatar,
+ File.join(Rails.root, 'public', 'gitlab_logo.png')
+ )
+ click_button 'Save changes'
+ @project.reload
+ end
+
+ step 'I remove my project avatar' do
+ click_link 'Remove avatar'
+ @project.reload
+ end
+
+ step 'I should see the default project avatar' do
+ @project.avatar?.should be_false
+ end
+
+ step 'I should not see the "Remove avatar" button' do
+ page.should_not have_link('Remove avatar')
end
step 'I should see project "Shop" version' do
within '.project-side' do
- page.should have_content "Version: 6.7.0.pre"
+ page.should have_content 'Version: 6.7.0.pre'
end
end
@@ -45,12 +86,12 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
step 'I should see project "Forum" README' do
- page.should have_link "README.md"
- page.should have_content "Sample repo for testing gitlab features"
+ page.should have_link 'README.md'
+ page.should have_content 'Sample repo for testing gitlab features'
end
step 'I should see project "Shop" README' do
- page.should have_link "README.md"
- page.should have_content "testme"
+ page.should have_link 'README.md'
+ page.should have_content 'testme'
end
end
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index 805e6ff0eac..1caad73654b 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -78,7 +78,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I click link "Diff"' do
- click_link 'Diff'
+ click_link 'Preview changes'
end
step 'I click on "Commit Changes"' do
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index 33ef6ccacf1..cef48c179b2 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -284,11 +284,11 @@ module SharedPaths
end
step 'I am on the new file page' do
- current_path.should eq(project_new_tree_path(@project, root_ref))
+ current_path.should eq(project_create_blob_path(@project, root_ref))
end
step 'I am on the ".gitignore" edit file page' do
- current_path.should eq(project_edit_tree_path(
+ current_path.should eq(project_edit_blob_path(
@project, File.join(root_ref, '.gitignore')))
end