summaryrefslogtreecommitdiff
path: root/features/project/source/browse_files.feature
diff options
context:
space:
mode:
Diffstat (limited to 'features/project/source/browse_files.feature')
-rw-r--r--features/project/source/browse_files.feature69
1 files changed, 67 insertions, 2 deletions
diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature
index 83f23f66e34..90b966dd645 100644
--- a/features/project/source/browse_files.feature
+++ b/features/project/source/browse_files.feature
@@ -30,27 +30,92 @@ Feature: Project Source Browse Files
And I edit code
And I fill the new file name
And I fill the commit message
- And I click on "Commit changes"
+ And I click on "Commit Changes"
+ Then I am redirected to the new file
+ And I should see its new content
+
+ @javascript
+ Scenario: I can create and commit file and specify new branch
+ Given I click on "new file" link in repo
+ And I edit code
+ And I fill the new file name
+ And I fill the commit message
+ And I fill the new branch name
+ And I click on "Commit Changes"
+ Then I am redirected to the new file on new branch
+ And I should see its new content
+
+ @javascript @tricky
+ Scenario: I can create file in empty repo
+ Given I own an empty project
+ And I visit my empty project page
+ And I create bare repo
+ When I click on "add a file" link
+ And I edit code
+ And I fill the new file name
+ And I fill the commit message
+ And I click on "Commit Changes"
Then I am redirected to the new file
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"
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
And I click button "Edit"
And I edit code
And I fill the commit message
- And I click on "Commit changes"
+ And I click on "Commit Changes"
Then I am redirected to the ".gitignore"
And I should see its new content
@javascript
+ Scenario: I can edit and commit file to new branch
+ Given I click on ".gitignore" file in repo
+ And I click button "Edit"
+ And I edit code
+ And I fill the commit message
+ And I fill the new branch name
+ And I click on "Commit Changes"
+ Then I am redirected to the ".gitignore" on new branch
+ 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
And I click button "Edit"