2019-05-28 06:05:20 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'User promotes label' do
|
2020-02-26 13:09:24 -05:00
|
|
|
let_it_be(:group) { create(:group) }
|
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
let_it_be(:project) { create(:project, namespace: group) }
|
|
|
|
let_it_be(:label) { create(:label, project: project) }
|
2019-05-28 06:05:20 -04:00
|
|
|
|
|
|
|
context 'when user can admin group labels' do
|
|
|
|
before do
|
|
|
|
group.add_developer(user)
|
|
|
|
sign_in(user)
|
|
|
|
visit(project_labels_path(project))
|
|
|
|
end
|
|
|
|
|
|
|
|
it "shows label promote button" do
|
|
|
|
expect(page).to have_selector('.js-promote-project-label-button')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when user cannot admin group labels' do
|
|
|
|
before do
|
|
|
|
project.add_developer(user)
|
|
|
|
sign_in(user)
|
|
|
|
visit(project_labels_path(project))
|
|
|
|
end
|
|
|
|
|
|
|
|
it "does not show label promote button" do
|
|
|
|
expect(page).not_to have_selector('.js-promote-project-label-button')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|