2018-10-26 08:49:16 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 14:09:03 -04:00
|
|
|
RSpec.describe BoardProjectRecentVisit do
|
2021-05-11 11:10:20 -04:00
|
|
|
let_it_be(:board_parent) { create(:project) }
|
|
|
|
let_it_be(:board) { create(:board, project: board_parent) }
|
2018-10-26 08:49:16 -04:00
|
|
|
|
|
|
|
describe 'relationships' do
|
|
|
|
it { is_expected.to belong_to(:user) }
|
|
|
|
it { is_expected.to belong_to(:project) }
|
|
|
|
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(:project) }
|
|
|
|
it { is_expected.to validate_presence_of(:board) }
|
|
|
|
end
|
|
|
|
|
2021-05-11 11:10:20 -04:00
|
|
|
it_behaves_like 'boards recent visit' do
|
|
|
|
let_it_be(:board_relation) { :board }
|
|
|
|
let_it_be(:board_parent_relation) { :project }
|
|
|
|
let_it_be(:visit_relation) { :board_project_recent_visit }
|
2018-10-26 08:49:16 -04:00
|
|
|
end
|
|
|
|
end
|