Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabina committed Jan 22, 2025
1 parent f55d8f2 commit 51dd4bb
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions spec/services/update_course_wiki_timeslices_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@
let(:flags) { nil }
let(:user) { create(:user, username: 'Ragesoss') }

before do
stub_wiki_validation
travel_to Date.new(2018, 12, 1)
course.campaigns << Campaign.first
course.wikis << Wiki.get_or_create(language: nil, project: 'wikidata')
JoinCourse.new(course:, user:, role: 0)
end

context 'when debugging is not enabled' do
it 'posts no Sentry logs' do
expect(Sentry).not_to receive(:capture_message)
processed, reprocessed = subject
expect(processed).to eq(7)
expect(processed).to eq(14)
expect(reprocessed).to eq(0)
end
end
Expand All @@ -33,15 +41,6 @@
end

context 'when there are revisions' do
before do
stub_wiki_validation
travel_to Date.new(2018, 12, 1)
course.campaigns << Campaign.first
# Create course wiki timeslices manually for wikidata
course.wikis << Wiki.get_or_create(language: nil, project: 'wikidata')
JoinCourse.new(course:, user:, role: 0)
end

it 'updates article course timeslices caches' do
VCR.use_cassette 'course_update' do
subject
Expand Down

0 comments on commit 51dd4bb

Please sign in to comment.