Skip to content

Commit

Permalink
fix: removes unneeded test code
Browse files Browse the repository at this point in the history
Seed Items was moved out of a model
  • Loading branch information
elasticspoon committed Mar 28, 2024
1 parent a24d572 commit 441a770
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions spec/models/base_item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,6 @@
end
end

describe "Methods >" do
describe '.seed_items' do
let(:fake_base_items_data) do
{
'category1' => [
{'name' => 'Item1', 'key' => 'key1'},
{'name' => 'Item2', 'key' => 'key2'}
],
'category2' => [
{'name' => 'Item3', 'key' => 'key3'}
]
}
end

before do
allow(File).to receive(:read).with(Rails.root.join("db", "base_items.json")).and_return('')
allow(JSON).to receive(:parse).and_return(fake_base_items_data)
end

it 'creates base items' do
expect {
described_class.seed_items
}.to change(BaseItem, :count).by(3)
end

it 'creates base items with correct attributes' do
described_class.seed_items

expect(BaseItem.exists?(name: 'Item1', category: 'category1', partner_key: 'key1')).to be_truthy
expect(BaseItem.exists?(name: 'Item2', category: 'category1', partner_key: 'key2')).to be_truthy
expect(BaseItem.exists?(name: 'Item3', category: 'category2', partner_key: 'key3')).to be_truthy
end
end
end

describe "Filtering >" do
describe '->without_kit' do
subject { BaseItem.without_kit }
Expand Down

0 comments on commit 441a770

Please sign in to comment.