summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-02 15:06:19 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-02 15:06:19 +0100
commit15a1acb4796406155fb01c2d93747b66697f50c0 (patch)
tree1ab73338bfa9bf2e56f8238d532e627f9e1f5b38 /features
parentb67f8eee0d2810be4a010c5e968e1848b4ca3c88 (diff)
parent6cffcb05882b0d3c4a02f9acf21806e25ea09ec3 (diff)
downloadgitlab-ce-15a1acb4796406155fb01c2d93747b66697f50c0.tar.gz
Merge remote-tracking branch 'origin/master' into git-raw-workhorse
Diffstat (limited to 'features')
-rw-r--r--features/project/source/browse_files.feature10
-rw-r--r--features/steps/project/source/browse_files.rb17
2 files changed, 27 insertions, 0 deletions
diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature
index a8c276b949e..1e09dbc4c8f 100644
--- a/features/project/source/browse_files.feature
+++ b/features/project/source/browse_files.feature
@@ -320,3 +320,13 @@ Feature: Project Source Browse Files
Then I should see download link and object size
And I should not see lfs pointer details
And I should see buttons for allowed commands
+
+ @javascript
+ Scenario: I preview an SVG file
+ Given I click on "Upload file" link in repo
+ And I upload a new SVG file
+ And I fill the upload file commit message
+ And I fill the new branch name
+ And I click on "Upload file"
+ Given I visit the SVG file
+ Then I can see the new rendered SVG image
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index 71db552f7b4..51b15791674 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -351,6 +351,19 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
expect(page).to have_content "You're not allowed to make changes to this project directly. A fork of this project has been created that you can make changes in, so you can submit a merge request."
end
+ # SVG files
+ step 'I upload a new SVG file' do
+ drop_in_dropzone test_svg_file
+ end
+
+ step 'I visit the SVG file' do
+ visit namespace_project_blob_path(@project.namespace, @project, 'new_branch_name/logo_sample.svg')
+ end
+
+ step 'I can see the new rendered SVG image' do
+ expect(find('.file-content')).to have_css('img')
+ end
+
private
def set_new_content
@@ -410,4 +423,8 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
def test_image_file
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
end
+
+ def test_svg_file
+ File.join(Rails.root, 'spec', 'fixtures', 'logo_sample.svg')
+ end
end