debian-mirror-gitlab/spec/models/board_group_recent_visit_spec.rb

27 lines
773 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe BoardGroupRecentVisit do
2021-06-08 01:23:25 +05:30
let_it_be(:board_parent) { create(:group) }
let_it_be(:board) { create(:board, group: board_parent) }
2018-12-13 13:39:08 +05:30
describe 'relationships' do
it { is_expected.to belong_to(:user) }
it { is_expected.to belong_to(:group) }
it { is_expected.to belong_to(:board) }
end
describe 'validations' do
it { is_expected.to validate_presence_of(:user) }
it { is_expected.to validate_presence_of(:group) }
it { is_expected.to validate_presence_of(:board) }
end
2021-06-08 01:23:25 +05:30
it_behaves_like 'boards recent visit' do
let_it_be(:board_relation) { :board }
let_it_be(:board_parent_relation) { :group }
let_it_be(:visit_relation) { :board_group_recent_visit }
2018-12-13 13:39:08 +05:30
end
end