DEV: Apply syntax_tree formatting to spec/*

This commit is contained in:
David Taylor
2023-01-09 11:18:21 +00:00
parent 0cf6421716
commit cb932d6ee1
907 changed files with 58693 additions and 45909 deletions

View File

@ -1,27 +1,25 @@
# frozen_string_literal: true
require 'wizard'
require "wizard"
RSpec.describe Wizard::Step do
let(:wizard) { Wizard.new(Fabricate.build(:user)) }
let(:step) { wizard.create_step('test-step') }
let(:step) { wizard.create_step("test-step") }
it "supports fields and options" do
expect(step.fields).to be_empty
text = step.add_field(id: 'test', type: 'text')
text = step.add_field(id: "test", type: "text")
expect(step.fields).to eq([text])
dropdown = step.add_field(id: 'snacks', type: 'dropdown')
dropdown.add_choice('candy')
dropdown.add_choice('nachos', data: { color: 'yellow' })
dropdown.add_choice('pizza', label: 'Pizza!')
dropdown = step.add_field(id: "snacks", type: "dropdown")
dropdown.add_choice("candy")
dropdown.add_choice("nachos", data: { color: "yellow" })
dropdown.add_choice("pizza", label: "Pizza!")
expect(step.fields).to eq([text, dropdown])
expect(dropdown.choices.size).to eq(3)
checkbox = step.add_field(id: 'foobar', type: 'checkbox', disabled: true)
checkbox = step.add_field(id: "foobar", type: "checkbox", disabled: true)
expect(step.fields).to eq([text, dropdown, checkbox])
expect(checkbox.disabled).to eq(true)
end
end