2018-12-13 01:54:30 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-04-03 09:20:50 -04:00
|
|
|
require "spec_helper"
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe "User views labels" do
|
2020-02-26 13:09:24 -05:00
|
|
|
let_it_be(:project) { create(:project_empty_repo, :public) }
|
|
|
|
let_it_be(:user) { create(:user) }
|
2021-04-21 02:09:28 -04:00
|
|
|
|
2018-12-13 01:54:30 -05:00
|
|
|
let(:label_titles) { %w[bug enhancement feature] }
|
2019-04-12 06:54:23 -04:00
|
|
|
let!(:prioritized_label) { create(:label, project: project, title: 'prioritized-label-name', priority: 1) }
|
2018-04-03 09:20:50 -04:00
|
|
|
|
|
|
|
before do
|
2018-12-13 01:54:30 -05:00
|
|
|
label_titles.each { |title| create(:label, project: project, title: title) }
|
2018-04-03 09:20:50 -04:00
|
|
|
|
|
|
|
project.add_guest(user)
|
|
|
|
sign_in(user)
|
|
|
|
|
|
|
|
visit(project_labels_path(project))
|
|
|
|
end
|
|
|
|
|
|
|
|
it "shows all labels" do
|
2019-04-12 06:54:23 -04:00
|
|
|
page.within('.prioritized-labels .manage-labels-list') do
|
|
|
|
expect(page).to have_content('prioritized-label-name')
|
|
|
|
end
|
|
|
|
|
2018-04-03 09:20:50 -04:00
|
|
|
page.within('.other-labels .manage-labels-list') do
|
2018-12-13 01:54:30 -05:00
|
|
|
label_titles.each { |title| expect(page).to have_content(title) }
|
2018-04-03 09:20:50 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|