2019-02-15 15:39:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
require "spec_helper"
|
|
|
|
|
|
|
|
describe "User views labels" do
|
|
|
|
set(:project) { create(:project_empty_repo, :public) }
|
|
|
|
set(:user) { create(:user) }
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
let(:label_titles) { %w[bug enhancement feature] }
|
2019-07-31 22:56:46 +05:30
|
|
|
let!(:prioritized_label) { create(:label, project: project, title: 'prioritized-label-name', priority: 1) }
|
2018-05-09 12:01:36 +05:30
|
|
|
|
|
|
|
before do
|
2019-02-15 15:39:39 +05:30
|
|
|
label_titles.each { |title| create(:label, project: project, title: title) }
|
2018-05-09 12:01:36 +05:30
|
|
|
|
|
|
|
project.add_guest(user)
|
|
|
|
sign_in(user)
|
|
|
|
|
|
|
|
visit(project_labels_path(project))
|
|
|
|
end
|
|
|
|
|
|
|
|
it "shows all labels" do
|
2019-07-31 22:56:46 +05:30
|
|
|
page.within('.prioritized-labels .manage-labels-list') do
|
|
|
|
expect(page).to have_content('prioritized-label-name')
|
|
|
|
end
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
page.within('.other-labels .manage-labels-list') do
|
2019-02-15 15:39:39 +05:30
|
|
|
label_titles.each { |title| expect(page).to have_content(title) }
|
2018-05-09 12:01:36 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|