Commit 937db37d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Optimize LFS objects specs

parent 3142b361
require 'spec_helper' require 'spec_helper'
describe LfsObjectsProject do describe LfsObjectsProject do
subject { create(:lfs_objects_project, project: project) } set(:project) { create(:project) }
let(:project) { create(:project) }
subject do
create(:lfs_objects_project, project: project)
end
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
...@@ -11,9 +14,13 @@ describe LfsObjectsProject do ...@@ -11,9 +14,13 @@ describe LfsObjectsProject do
describe 'validation' do describe 'validation' do
it { is_expected.to validate_presence_of(:lfs_object_id) } it { is_expected.to validate_presence_of(:lfs_object_id) }
it { is_expected.to validate_uniqueness_of(:lfs_object_id).scoped_to(:project_id).with_message("already exists in project") }
it { is_expected.to validate_presence_of(:project_id) } it { is_expected.to validate_presence_of(:project_id) }
it 'validates object id' do
is_expected.to validate_uniqueness_of(:lfs_object_id)
.scoped_to(:project_id)
.with_message("already exists in project") }
end
end end
describe '#update_project_statistics' do describe '#update_project_statistics' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment