-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9844 from alphagov/content-modelling/fix-test-naming
Rename `WorkflowTest`
- Loading branch information
Showing
2 changed files
with
44 additions
and
46 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
lib/engines/content_block_manager/test/unit/app/controllers/concerns/workflow_step_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
46 changes: 0 additions & 46 deletions
46
lib/engines/content_block_manager/test/unit/app/controllers/concerns/workflow_test.rb
This file was deleted.
Oops, something went wrong.