Commit 75cecf36 authored by Marin Jankovski's avatar Marin Jankovski

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

parent d40a7de1
......@@ -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
......@@ -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
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