Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-25 10:40:28 +01:00
23 Zeilen
563 B
Ruby
23 Zeilen
563 B
Ruby
|
require 'rails_helper'
|
||
|
|
||
|
describe CustomWizardStepExtension do
|
||
|
let(:step_hash) do
|
||
|
JSON.parse(File.open(
|
||
|
"#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/step/step.json"
|
||
|
).read).with_indifferent_access
|
||
|
end
|
||
|
|
||
|
it "adds custom step attributes" do
|
||
|
step = Wizard::Step.new(step_hash[:id])
|
||
|
[
|
||
|
:title,
|
||
|
:description,
|
||
|
:key,
|
||
|
:permitted,
|
||
|
:permitted_message
|
||
|
].each do |attr|
|
||
|
step.send("#{attr.to_s}=", step_hash[attr])
|
||
|
expect(step.send(attr)).to eq(step_hash[attr])
|
||
|
end
|
||
|
end
|
||
|
end
|