Commit 75cecf36e0d60bd4ca1dce0997745268b49eaee5

Authored by Marin Jankovski
1 parent d40a7de1

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

features/public/public_projects.feature
... ... @@ -79,3 +79,20 @@ Feature: Public Projects Feature
79 79 Given I visit project "Internal" page
80 80 And I visit "Internal" issues page
81 81 Then I should see list of issues for "Internal" project
  82 +
  83 + Scenario: I visit public project merge requests page as an authorized user
  84 + Given I sign in as a user
  85 + Given I visit project "Community" page
  86 + And I visit "Community" merge requests page
  87 + Then I should see list of merge requests for "Community" project
  88 +
  89 + Scenario: I visit public project merge requests page as a non authorized user
  90 + Given I visit project "Community" page
  91 + And I visit "Community" merge requests page
  92 + Then I should see list of merge requests for "Community" project
  93 +
  94 + Scenario: I visit internal project merge requests page as an authorized user
  95 + Given I sign in as a user
  96 + Given I visit project "Internal" page
  97 + And I visit "Internal" merge requests page
  98 + Then I should see list of merge requests for "Internal" project
... ...
features/steps/public/projects_feature.rb
... ... @@ -151,5 +151,59 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
151 151 page.should have_content project.name
152 152 page.should have_content "New internal feature"
153 153 end
  154 +
  155 + step 'I visit "Community" merge requests page' do
  156 + project = Project.find_by(name: 'Community')
  157 + create(:merge_request,
  158 + title: "Bug fix",
  159 + source_project: project,
  160 + target_project: project,
  161 + source_branch: 'stable',
  162 + target_branch: 'master',
  163 + )
  164 + create(:merge_request,
  165 + title: "Feature created",
  166 + source_project: project,
  167 + target_project: project,
  168 + source_branch: 'stable',
  169 + target_branch: 'master',
  170 + )
  171 + visit project_merge_requests_path(project)
  172 + end
  173 +
  174 + step 'I should see list of merge requests for "Community" project' do
  175 + project = Project.find_by(name: 'Community')
  176 +
  177 + page.should have_content "Bug fix"
  178 + page.should have_content project.name
  179 + page.should have_content "Feature created"
  180 + end
  181 +
  182 + step 'I visit "Internal" merge requests page' do
  183 + project = Project.find_by(name: 'Internal')
  184 + create(:merge_request,
  185 + title: "Bug fix internal",
  186 + source_project: project,
  187 + target_project: project,
  188 + source_branch: 'stable',
  189 + target_branch: 'master',
  190 + )
  191 + create(:merge_request,
  192 + title: "Feature created for internal",
  193 + source_project: project,
  194 + target_project: project,
  195 + source_branch: 'stable',
  196 + target_branch: 'master',
  197 + )
  198 + visit project_merge_requests_path(project)
  199 + end
  200 +
  201 + step 'I should see list of merge requests for "Internal" project' do
  202 + project = Project.find_by(name: 'Internal')
  203 +
  204 + page.should have_content "Bug fix internal"
  205 + page.should have_content project.name
  206 + page.should have_content "Feature created for internal"
  207 + end
154 208 end
155 209  
... ...