Skip to content

Commit

Permalink
add missing spec for new action, fix rod form bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubik committed Apr 20, 2023
1 parent 6654444 commit 1b68d5d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/admin/required_operator_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
f.input :forest_types, as: :string, input_html: {disabled: editing}
else
f.input :forest_types, as: :select, multiple: true,
collection: -> { ForestType.select_collection },
collection: ForestType.select_collection,
include_blank: true
end

Expand Down
13 changes: 13 additions & 0 deletions spec/controllers/active_admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@
end
end
end

if resource.is_a?(ActiveAdmin::Page) || resource.defined_actions.include?(:new)
describe "GET new" do
subject { get :new }

it { is_expected.to be_successful }

it "does not include empty translations" do
subject
expect(response.body).not_to include("translation missing")
end
end
end
end
end
end

0 comments on commit 1b68d5d

Please sign in to comment.