diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-08-21 16:34:14 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-08-21 16:34:34 +0100 |
commit | e905cbda6e1577d4a9c11da899d11aeb2e637035 (patch) | |
tree | ba3102d9f6d0362367cb8d963ca7654dcd2f398e | |
parent | 4a4dc2bbdc2d7257744b525d3c2fe0df7c68630f (diff) | |
download | gitlab-ci-build-triggers.tar.gz |
Added TriggerController specsbuild-triggers
-rw-r--r-- | app/models/commit.rb | 2 | ||||
-rw-r--r-- | spec/features/triggers_spec.rb | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 8b1def5..98bd35c 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -244,7 +244,7 @@ class Commit < ActiveRecord::Base end def skip_ci? - return if builds.any? + return false if builds.any? commits = push_data[:commits] commits.present? && commits.last[:message] =~ /(\[ci skip\])/ end diff --git a/spec/features/triggers_spec.rb b/spec/features/triggers_spec.rb new file mode 100644 index 0000000..2076429 --- /dev/null +++ b/spec/features/triggers_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe 'Variables' do + before do + login_as :user + @project = FactoryGirl.create :project + stub_js_gitlab_calls + visit project_triggers_path(@project) + end + + context 'create a trigger' do + before do + click_on 'Add Trigger' + @project.triggers.count.should == 1 + end + + it 'contains trigger token' do + page.should have_content(@project.triggers.first.token) + end + + it 'revokes the trigger' do + click_on 'Revoke' + @project.triggers.count.should == 0 + end + end +end |