Fix tests

This commit is contained in:
Luke "Jared" Bennett 2016-12-20 13:53:24 +00:00
parent f7b7e918fe
commit ccfbbf7dfa
No known key found for this signature in database
GPG Key ID: 402ED51FB5D306C2
1 changed files with 5 additions and 35 deletions

View File

@ -32,49 +32,19 @@ feature 'Setup Mattermost slash commands', feature: true do
end
describe 'mattermost service is enabled' do
let(:info) { find('.services-installation-info') }
before do
Gitlab.config.mattermost.enabled = true
allow(Gitlab.config.mattermost).to receive(:enabled).and_return(true)
end
it 'shows the correct mattermost url' do
expect(page).to have_content Gitlab.config.mattermost.host
end
describe 'mattermost service is active' do
before do
service.active = true
end
it 'shows that mattermost is active' do
expect(info).to have_content 'Installed'
expect(info).not_to have_content 'Not installed'
end
it 'shows the edit mattermost button' do
expect(info).to have_button 'Edit Mattermost'
end
end
describe 'mattermost service is not active' do
before do
service.active = false
end
it 'shows that mattermost is not active' do
expect(info).to have_content 'Not installed'
end
it 'shows the add to mattermost button' do
expect(info).to have_button 'Add to Mattermost'
end
it 'shows the add to mattermost button' do
expect(page).to have_link 'Add to Mattermost'
end
end
describe 'mattermost service is not enabled' do
before do
Gitlab.config.mattermost.enabled = false
allow(Gitlab.config.mattermost).to receive(:enabled).and_return(false)
end
it 'shows the correct trigger url' do