2019-07-07 11:18:12 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe RepositoryLanguage do
|
2018-11-18 11:00:15 +05:30
|
|
|
let(:repository_language) { build(:repository_language) }
|
|
|
|
|
|
|
|
describe 'associations' do
|
|
|
|
it { is_expected.to belong_to(:project) }
|
|
|
|
it { is_expected.to belong_to(:programming_language) }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'validations' do
|
|
|
|
it { is_expected.to allow_value(0).for(:share) }
|
|
|
|
it { is_expected.to allow_value(100.0).for(:share) }
|
|
|
|
it { is_expected.not_to allow_value(100.1).for(:share) }
|
|
|
|
end
|
|
|
|
end
|