summaryrefslogtreecommitdiff
path: root/spec/features/ci/triggers_spec.rb
blob: c6afeb746281fa1307aa42612454e81ec8955d1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'spec_helper'

describe 'Triggers' do
  let(:user)    { create(:user) }

  before do
    login_as(user)
    @project = FactoryGirl.create :ci_project
    @project.gl_project.team << [user, :master]
    visit ci_project_triggers_path(@project)
  end

  context 'create a trigger' do
    before do
      click_on 'Add Trigger'
      expect(@project.triggers.count).to eq(1)
    end

    it 'contains trigger token' do
      expect(page).to have_content(@project.triggers.first.token)
    end

    it 'revokes the trigger' do
      click_on 'Revoke'
      expect(@project.triggers.count).to eq(0)
    end
  end
end