Skip to content

Commit

Permalink
meet Hound require
Browse files Browse the repository at this point in the history
  • Loading branch information
jubilee2 committed Apr 17, 2023
1 parent ea76c97 commit 36fb3ab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 7 additions & 0 deletions spec/controllers/admin/application_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,11 @@ def index
)
end
end

describe "GET #index" do
it "assigns the action name as a string" do
get :index
expect(controller.action_name).to be_a(String)
end
end
end
15 changes: 9 additions & 6 deletions spec/dashboards/line_item_dashboard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,23 @@
end
end
end

describe "#permitted_attributes" do
it "returns the attribute name by default" do
expect(dashboard.permitted_attributes).to eq(["order_id", "product_id", :quantity, :unit_price])
attributes = ["order_id", "product_id", :quantity, :unit_price]
expect(dashboard.permitted_attributes).to eq(attributes)
end

it "returns the attribute name for new/create actions" do
expect(dashboard.permitted_attributes(:new)).to eq(["order_id", "product_id"])
expect(dashboard.permitted_attributes(:create)).to eq(["order_id", "product_id"])
attributes = ["order_id", "product_id"]
expect(dashboard.permitted_attributes("new")).to eq(attributes)
expect(dashboard.permitted_attributes("create")).to eq(attributes)
end

it "returns the attribute name for edit/update actions" do
expect(dashboard.permitted_attributes(:edit)).to eq(["order_id", "product_id", :quantity])
expect(dashboard.permitted_attributes(:update)).to eq(["order_id", "product_id", :quantity])
attributes = ["order_id", "product_id", :quantity]
expect(dashboard.permitted_attributes("edit")).to eq(attributes)
expect(dashboard.permitted_attributes("update")).to eq(attributes)
end
end
end

0 comments on commit 36fb3ab

Please sign in to comment.