Commit 6b8d2328 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'blackst0ne-replace-spinach-project-issues-weight.feature' into 'master'

Replace the `project/issues/weight.feature` spinach test with an rspec analog

See merge request gitlab-org/gitlab-ee!5194
parents d17f327d fc568ffc
---
title: Replace the `project/issues/weight.feature` spinach test with an rspec analog
merge_request: 5194
author: blackst0ne
type: other
require "spec_helper"
describe "User creates issue", :js do
let(:project) { create(:project_empty_repo, :public) }
let(:user) { create(:user) }
before do
stub_licensed_features(issue_weights: true)
project.add_developer(user)
sign_in(user)
visit(new_project_issue_path(project))
end
context "with weight set" do
it "creates issue" do
issue_title = "500 error on profile"
weight = "7"
fill_in("Title", with: issue_title)
click_button("Weight")
page.within(".dropdown-menu-weight") do
click_link(weight)
end
click_button("Submit issue")
page.within(".weight") do
expect(page).to have_content(weight)
end
expect(page).to have_content(issue_title)
end
end
end
Feature: Project Issues Weight
Background:
Given I sign in as a user
And I own project "Shop"
Given I visit project "Shop" issues page
@javascript
Scenario: I should see labels list
Given I click link "New Issue"
And I submit new issue "500 error on profile" with weight
Then I should see issue "500 error on profile" with weight
class Spinach::Features::ProjectIssuesWeight < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
step 'I click link "New Issue"' do
within '.row' do
click_link "New issue"
end
end
step 'I submit new issue "500 error on profile" with weight' do
fill_in "issue_title", with: "500 error on profile"
click_button 'Weight'
page.within '.dropdown-menu-weight' do
click_link '7'
end
click_button "Submit issue"
end
step 'I should see issue "500 error on profile" with weight' do
issue = Issue.find_by(title: "500 error on profile")
page.within '.weight' do
expect(page).to have_content '7'
end
expect(page).to have_content issue.title
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