Commit 1b3bb52a authored by Bryce Johnson's avatar Bryce Johnson

Fix feature spec contexts.

parent a2a17e0e
......@@ -3,14 +3,10 @@ require 'spec_helper'
describe 'Service Desk Issue Tracker', focus: true do
let(:project) { create(:project, :private, service_desk_enabled: true) }
let(:user) { create(:user) }
let(:regular_issue) { create(:issue, project: project, title: 'My invisible issue', author: user) }
let(:service_desk_issue) { create(:issue, project: project, title: 'My visible issue', author: User.support_bot) }
before do
allow(License).to receive(:feature_available?).and_call_original
allow(License).to receive(:feature_available?).with(:service_desk) { true }
allow(Gitlab::IncomingEmail).to receive(:enabled?) { true }
allow(Gitlab::IncomingEmail).to receive(:supports_wildcard?) { true }
project.add_master(user)
sign_in(user)
......@@ -30,7 +26,6 @@ describe 'Service Desk Issue Tracker', focus: true do
describe 'issues list', js: true do
before do
puts service_desk_project_issues_path(project)
visit service_desk_project_issues_path(project)
end
......@@ -50,6 +45,12 @@ describe 'Service Desk Issue Tracker', focus: true do
end
end
context 'when service desk has been activated' do
before do
allow(Gitlab::IncomingEmail).to receive(:enabled?) { true }
allow(Gitlab::IncomingEmail).to receive(:supports_wildcard?) { true }
end
context 'when there are no issues' do
describe 'service desk info content' do
it 'displays the large info box' do
......@@ -71,6 +72,8 @@ describe 'Service Desk Issue Tracker', focus: true do
end
context 'when there are issues' do
let(:regular_issue) { create(:issue, project: project, title: 'My invisible issue', author: user) }
let(:service_desk_issue) { create(:issue, project: project, title: 'My visible issue', author: User.support_bot) }
describe 'service desk info content' do
it 'displays the small info box' do
......@@ -109,4 +112,5 @@ describe 'Service Desk Issue Tracker', focus: true do
end
end
end
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