2020-11-30 22:20:10 +01:00
|
|
|
require_relative '../plugin_helper'
|
2020-11-03 01:24:20 +01:00
|
|
|
|
|
|
|
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
|
2021-02-24 08:50:42 +01:00
|
|
|
|
2020-11-03 01:24:20 +01:00
|
|
|
it "adds custom step attributes" do
|
2021-02-24 08:50:42 +01:00
|
|
|
step = Wizard::Step.new(step_hash[:id])
|
2020-11-03 01:24:20 +01:00
|
|
|
[
|
|
|
|
: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
|
2021-02-24 08:50:42 +01:00
|
|
|
end
|
|
|
|
end
|