2014-05-02 21:38:28 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe BuildScript do
|
|
|
|
before { stub_symlink_methods }
|
|
|
|
|
|
|
|
let(:build_script) { FactoryGirl.build(:build_script) }
|
|
|
|
|
|
|
|
it 'is valid given valid attributes' do
|
|
|
|
build_script.should be_valid
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'ensures that validations and associations exist' do
|
|
|
|
it { should belong_to(:project) }
|
|
|
|
|
2014-11-25 17:33:54 +00:00
|
|
|
it { should validate_presence_of(:project) }
|
2014-05-02 21:38:28 +01:00
|
|
|
it { should validate_presence_of(:treeish) }
|
|
|
|
|
|
|
|
context 'uniqueness' do
|
|
|
|
before { build_script.save }
|
|
|
|
it { should validate_uniqueness_of(:project_id).scoped_to(:treeish) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|