Skip to content

Commit

Permalink
Merge pull request #9844 from alphagov/content-modelling/fix-test-naming
Browse files Browse the repository at this point in the history
Rename `WorkflowTest`
  • Loading branch information
pezholio authored Jan 24, 2025
2 parents 4b12497 + a68aa67 commit 10b1500
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
require "test_helper"

class ContentBlockManager::ContentBlock::WorkflowStepTest < ActiveSupport::TestCase
extend Minitest::Spec::DSL

describe ".by_name" do
it "returns a step by its name" do
step = Workflow::Step.by_name("review_links")

assert_equal step&.name, :review_links
end
end

describe "#next_step" do
[
%i[edit_draft review_links],
%i[review_links schedule_publishing],
%i[schedule_publishing internal_note],
%i[internal_note change_note],
%i[change_note review],
%i[review confirmation],
].each do |current_step, expected_step|
it "returns #{expected_step} step when the current step is #{current_step}" do
step = Workflow::Step.by_name(current_step)
assert_equal step&.next_step&.name, expected_step
end
end
end

describe "#previous_step" do
[
%i[review_links edit_draft],
%i[schedule_publishing review_links],
%i[internal_note schedule_publishing],
%i[change_note internal_note],
%i[review change_note],
].each do |current_step, expected_step|
it "returns #{expected_step} step when the current step is #{current_step}" do
step = Workflow::Step.by_name(current_step)
assert_equal step&.previous_step&.name, expected_step
end
end
end
end

This file was deleted.

0 comments on commit 10b1500

Please sign in to comment.