Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-20 16:37:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-20 16:37:47 +0300
commitaee0a117a889461ce8ced6fcf73207fe017f1d99 (patch)
tree891d9ef189227a8445d83f35c1b0fc99573f4380 /spec/models/timelog_spec.rb
parent8d46af3258650d305f53b819eabf7ab18d22f59e (diff)
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'spec/models/timelog_spec.rb')
-rw-r--r--spec/models/timelog_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/models/timelog_spec.rb b/spec/models/timelog_spec.rb
index d6c31307e30..f96d02e6a82 100644
--- a/spec/models/timelog_spec.rb
+++ b/spec/models/timelog_spec.rb
@@ -21,7 +21,7 @@ RSpec.describe Timelog do
it { expect(subject.project_id).not_to be_nil }
- describe 'Issuable validation' do
+ describe 'validation' do
it 'is invalid if issue_id and merge_request_id are missing' do
subject.attributes = { issue: nil, merge_request: nil }
@@ -139,4 +139,14 @@ RSpec.describe Timelog do
time + 1.day
end
end
+
+ describe 'hooks' do
+ describe '.set_project' do
+ it 'populates project with issuable project' do
+ timelog = create(:issue_timelog, issue: issue)
+
+ expect(timelog.project_id).to be(timelog.issue.project_id)
+ end
+ end
+ end
end