diff options
Diffstat (limited to 'spec/ci/models/trigger_spec.rb')
-rw-r--r-- | spec/ci/models/trigger_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/ci/models/trigger_spec.rb b/spec/ci/models/trigger_spec.rb new file mode 100644 index 00000000000..bba638e7817 --- /dev/null +++ b/spec/ci/models/trigger_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +describe Trigger do + let(:project) { FactoryGirl.create :project } + + describe 'before_validation' do + it 'should set an random token if none provided' do + trigger = FactoryGirl.create :trigger_without_token, project: project + trigger.token.should_not be_nil + end + + it 'should not set an random token if one provided' do + trigger = FactoryGirl.create :trigger, project: project + trigger.token.should == 'token' + end + end +end |