Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-02-02 19:32:12 +0400
committerMarin Jankovski <marin@gitlab.com>2014-02-02 19:32:12 +0400
commit75cecf36e0d60bd4ca1dce0997745268b49eaee5 (patch)
treee519aa8fb76760b1332c982dafff37af2f645db8 /features
parentd40a7de170e57ec72eb362b4e015e19fd35780d3 (diff)
Scenarios for checking if MR are shown for internal and public projects.
Diffstat (limited to 'features')
-rw-r--r--features/public/public_projects.feature17
-rw-r--r--features/steps/public/projects_feature.rb54
2 files changed, 71 insertions, 0 deletions
diff --git a/features/public/public_projects.feature b/features/public/public_projects.feature
index adfe97a4ce3..fae7789b9ff 100644
--- a/features/public/public_projects.feature
+++ b/features/public/public_projects.feature
@@ -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
diff --git a/features/steps/public/projects_feature.rb b/features/steps/public/projects_feature.rb
index 0453a1e62b5..e0a26402275 100644
--- a/features/steps/public/projects_feature.rb
+++ b/features/steps/public/projects_feature.rb
@@ -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