Skip to content

Commit

Permalink
Forgot to run linter on model files
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin-Couey committed Dec 3, 2024
1 parent 400803f commit ed609ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/models/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ def seed_items(item_collection)

def seed_random_item_with_name(name)
base_items = BaseItem.all.map(&:to_h)
base_item = Array.wrap(base_items).sample()
base_item = Array.wrap(base_items).sample
base_item[:name] = name
self.seed_items( base_item )
seed_items(base_item)
end

def valid_items
Expand Down
8 changes: 4 additions & 4 deletions spec/models/organization_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,11 @@

describe "#seed_random_item_with_name" do
it "adds an item with the given name" do
base_item = create(:base_item, name: "Foo", partner_key: "foo").to_h
create(:base_item, name: "Foo", partner_key: "foo").to_h
expect do
expect( organization.items.find_by(name: "NotFoo", partner_key: "foo") ).to be_nil
organization.seed_random_item_with_name( "NotFoo" )
expect( organization.items.find_by(name: "NotFoo", partner_key: "foo") ).to_not be_nil
expect(organization.items.find_by(name: "NotFoo", partner_key: "foo")).to be_nil
organization.seed_random_item_with_name("NotFoo")
expect(organization.items.find_by(name: "NotFoo", partner_key: "foo")).to_not be_nil
end.to change { organization.items.size }.by(1)
end
end
Expand Down

0 comments on commit ed609ad

Please sign in to comment.