2015-11-05 05:03:02 -05:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
RSpec.describe Release do
|
2018-12-13 06:08:53 -05:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project, :public, :repository) }
|
|
|
|
let(:release) { create(:release, project: project, author: user) }
|
2015-11-06 09:43:59 -05:00
|
|
|
|
|
|
|
it { expect(release).to be_valid }
|
|
|
|
|
|
|
|
describe 'associations' do
|
|
|
|
it { is_expected.to belong_to(:project) }
|
2018-12-12 04:56:43 -05:00
|
|
|
it { is_expected.to belong_to(:author).class_name('User') }
|
2015-11-06 09:43:59 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'validation' do
|
|
|
|
it { is_expected.to validate_presence_of(:project) }
|
|
|
|
it { is_expected.to validate_presence_of(:description) }
|
|
|
|
end
|
2015-11-05 05:03:02 -05:00
|
|
|
end
|