Commit 0100d3f8 authored by Douwe Maan's avatar Douwe Maan

Add tests

parent 0ec3e8c6
......@@ -3,23 +3,32 @@ Feature: Project Ff Merge Requests
Given I sign in as a user
And I own project "Shop"
And project "Shop" have "Bug NS-05" open merge request with diffs inside
And ff merge enabled
And merge request "Bug NS-05" is mergeable
@javascript
Scenario: I do ff-only merge
Given merge request "Bug NS-05" is rebased
Given ff merge enabled
And merge request "Bug NS-05" is rebased
When I visit merge request page "Bug NS-05"
Then I should see ff-only merge button
When I accept this merge request
Then I should see merged request
@javascript
Scenario: I do rebase before ff-only merge
Given rebase before merge enabled
Given ff merge enabled
And rebase before merge enabled
When I visit merge request page "Bug NS-05"
Then I should see rebase button
When I press rebase button
Then I should see rebase in progress message
And I should see ff-only merge button
Scenario: I should do rebase before ff-only merge
@javascript
Scenario: I do rebase before regular merge
Given rebase before merge enabled
When I visit merge request page "Bug NS-05"
Then I should not see rebase button
And I should see rebase message
Then I should see rebase button
When I press rebase button
Then I should see rebase in progress message
And I should see regular merge button
......@@ -21,7 +21,12 @@ class Spinach::Features::ProjectFfMergeRequests < Spinach::FeatureSteps
end
step 'I should see ff-only merge button' do
expect(page).to have_content "Fast-forward merge without creating merge commit"
expect(page).to have_content "Fast-forward merge without a merge commit"
expect(page).to have_button 'Accept Merge Request'
end
step 'I should see regular merge button' do
expect(page).to have_content "Modify commit message"
expect(page).to have_button 'Accept Merge Request'
end
......@@ -47,18 +52,10 @@ class Spinach::Features::ProjectFfMergeRequests < Spinach::FeatureSteps
project.save!
end
step 'I should not see rebase button' do
expect(page).to_not have_button "Rebase"
end
step 'I should see rebase button' do
expect(page).to have_button "Rebase"
end
step 'I should see rebase message' do
expect(page).to have_content "Fast-forward merge is not possible. Branch must be rebased first"
end
step 'merge request "Bug NS-05" is rebased' do
merge_request.source_branch = 'flatten-dir'
merge_request.target_branch = 'improve/awesome'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment