Commit 9ff69c4c authored by Marin Jankovski's avatar Marin Jankovski

Add tests for template mr description.

parent 7478ece8
......@@ -139,3 +139,7 @@ Feature: Project Merge Requests
And I click link "Show inline discussion" of the second file
Then I should see a comment like "Line is wrong" in the second file
And I should still see a comment like "Line is correct" in the first file
Scenario: I submit new unassigned merge request with template description
Given I click link "New Merge Request"
Then I should see description field pre-filled
......@@ -24,3 +24,10 @@ Feature: Project Feature
When I visit edit project "Shop" page
And change project path settings
Then I should see project with new path settings
Scenario: I visit edit project and fill in merge request template
When I visit edit project "Shop" page
Then I should see project settings
And I fill in merge request template
And I save project
Then I should see project with merge request template saved
......@@ -239,6 +239,10 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
end
step 'I should see description field pre-filled' do
find_field('merge_request_description').value.should == 'This merge request should contain the following.'
end
def project
@project ||= Project.find_by!(name: "Shop")
end
......
......@@ -14,6 +14,8 @@ class ProjectFeature < Spinach::FeatureSteps
step 'I should see project with new settings' do
find_field('project_name').value.should == 'NewName'
find('#project_issues_enabled').should_not be_checked
find('#project_merge_requests_enabled').should be_checked
end
step 'change project path settings' do
......@@ -24,4 +26,12 @@ class ProjectFeature < Spinach::FeatureSteps
step 'I should see project with new path settings' do
project.path.should == "new-path"
end
step 'I fill in merge request template' do
fill_in 'project_merge_requests_template', with: "This merge request should contain the following."
end
step 'I should see project with merge request template saved' do
find_field('project_merge_requests_template').value.should == 'This merge request should contain the following.'
end
end
......@@ -10,7 +10,7 @@ module SharedProject
# Create a specific project called "Shop"
And 'I own project "Shop"' do
@project = Project.find_by(name: "Shop")
@project ||= create(:project, name: "Shop", namespace: @user.namespace)
@project ||= create(:project, name: "Shop", namespace: @user.namespace, merge_requests_template: "This merge request should contain the following.")
@project.team << [@user, :master]
end
......
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