From 358d7eff7d1f4b7a3150d38d9dbe03fe02491ae2 Mon Sep 17 00:00:00 2001 From: Valeriy Sizov Date: Fri, 12 Oct 2012 19:56:06 +0300 Subject: [PATCH] WebEditor: spinach --- features/project/source/browse_files.feature | 6 ++++++ features/steps/project/project_browse_files.rb | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature index b12b0ee3..9a635fa6 100644 --- a/features/project/source/browse_files.feature +++ b/features/project/source/browse_files.feature @@ -19,3 +19,9 @@ Feature: Project Browse files Given I visit blob file from repo And I click link "raw" Then I should see raw file content + + @javascript + Scenario: I can edit file + Given I click on "Gemfile" file in repo + And I click button "Edit" + Then I can edit file diff --git a/features/steps/project/project_browse_files.rb b/features/steps/project/project_browse_files.rb index 652daba0..17b81a6f 100644 --- a/features/steps/project/project_browse_files.rb +++ b/features/steps/project/project_browse_files.rb @@ -31,4 +31,14 @@ class ProjectBrowseFiles < Spinach::FeatureSteps Then 'I should see raw file content' do page.source.should == ValidCommit::BLOB_FILE end + + Given 'I click button "Edit"' do + click_link 'Edit' + end + + Given 'I can edit file' do + page.execute_script('editor.setValue("GitlabFileEditor")') + page.evaluate_script('editor.getValue()').should == "GitlabFileEditor" + end + end