gitlab-org--gitlab-foss/spec/features/triggers_spec.rb

29 lines
645 B
Ruby
Raw Normal View History

2015-08-25 21:42:46 -04:00
require 'spec_helper'
2015-09-15 09:42:02 -04:00
describe 'Triggers' do
let(:user) { create(:user) }
before { login_as(user) }
2015-09-15 15:22:51 -04:00
2015-08-25 21:42:46 -04:00
before do
2015-12-04 06:55:23 -05:00
@project = FactoryGirl.create :empty_project
@project.team << [user, :master]
visit namespace_project_triggers_path(@project.namespace, @project)
2015-08-25 21:42:46 -04:00
end
context 'create a trigger' do
before do
click_on 'Add Trigger'
expect(@project.triggers.count).to eq(1)
2015-08-25 21:42:46 -04:00
end
it 'contains trigger token' do
expect(page).to have_content(@project.triggers.first.token)
2015-08-25 21:42:46 -04:00
end
it 'revokes the trigger' do
click_on 'Revoke'
expect(@project.triggers.count).to eq(0)
2015-08-25 21:42:46 -04:00
end
end
end