Skip to content

Commit

Permalink
Rewrite helpers spec
Browse files Browse the repository at this point in the history
  • Loading branch information
mantaskujalis committed Jul 25, 2024
1 parent b6f6d00 commit cf26afd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build_release_pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
bundle install
- name: Test
run: bundle exec rake
run: bundle exec rspec

- name: Build
id: build
Expand Down
28 changes: 28 additions & 0 deletions spec/lib/chained_job/helpers_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# frozen_string_literal: true

RSpec.describe ChainedJob::Helpers do
describe '.job_key' do
subject { described_class.job_key(job_arguments_key) }

let(:job_arguments_key) { 'DummyJob' }

it { is_expected.to eq("chained_job:#{job_arguments_key}") }
end

describe '.redis_key' do
subject { described_class.redis_key(job_key, tag) }

let(:job_key) { "chained_job:DummyJob" }
let(:tag) { '1595252432.198516' }

it { is_expected.to eq("#{job_key}:#{tag}") }
end

describe '.tag_list' do
subject { described_class.tag_list(prefix) }

let(:prefix) { 'DummyJob' }

it { is_expected.to eq("#{prefix}:tags") }
end
end

0 comments on commit cf26afd

Please sign in to comment.