Scenarios for checking if MR are shown for internal and public projects.

This commit is contained in:
Marin Jankovski
2014-02-02 16:32:12 +01:00
parent d40a7de170
commit 75cecf36e0
2 changed files with 71 additions and 0 deletions
+17
View File
@@ -79,3 +79,20 @@ Feature: Public Projects Feature
Given I visit project "Internal" page
And I visit "Internal" issues page
Then I should see list of issues for "Internal" project
Scenario: I visit public project merge requests page as an authorized user
Given I sign in as a user
Given I visit project "Community" page
And I visit "Community" merge requests page
Then I should see list of merge requests for "Community" project
Scenario: I visit public project merge requests page as a non authorized user
Given I visit project "Community" page
And I visit "Community" merge requests page
Then I should see list of merge requests for "Community" project
Scenario: I visit internal project merge requests page as an authorized user
Given I sign in as a user
Given I visit project "Internal" page
And I visit "Internal" merge requests page
Then I should see list of merge requests for "Internal" project
+54
View File
@@ -151,5 +151,59 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
page.should have_content project.name
page.should have_content "New internal feature"
end
step 'I visit "Community" merge requests page' do
project = Project.find_by(name: 'Community')
create(:merge_request,
title: "Bug fix",
source_project: project,
target_project: project,
source_branch: 'stable',
target_branch: 'master',
)
create(:merge_request,
title: "Feature created",
source_project: project,
target_project: project,
source_branch: 'stable',
target_branch: 'master',
)
visit project_merge_requests_path(project)
end
step 'I should see list of merge requests for "Community" project' do
project = Project.find_by(name: 'Community')
page.should have_content "Bug fix"
page.should have_content project.name
page.should have_content "Feature created"
end
step 'I visit "Internal" merge requests page' do
project = Project.find_by(name: 'Internal')
create(:merge_request,
title: "Bug fix internal",
source_project: project,
target_project: project,
source_branch: 'stable',
target_branch: 'master',
)
create(:merge_request,
title: "Feature created for internal",
source_project: project,
target_project: project,
source_branch: 'stable',
target_branch: 'master',
)
visit project_merge_requests_path(project)
end
step 'I should see list of merge requests for "Internal" project' do
project = Project.find_by(name: 'Internal')
page.should have_content "Bug fix internal"
page.should have_content project.name
page.should have_content "Feature created for internal"
end
end