mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-14 11:15:48 -04:00
Update plantings#index view spec to use hashes like an ES search result
This commit is contained in:
@@ -15,23 +15,28 @@ describe "plantings/index" do
|
|||||||
total_entries = 3
|
total_entries = 3
|
||||||
plantings = WillPaginate::Collection.create(page, per_page, total_entries) do |pager|
|
plantings = WillPaginate::Collection.create(page, per_page, total_entries) do |pager|
|
||||||
pager.replace([
|
pager.replace([
|
||||||
FactoryBot.create(:planting,
|
{
|
||||||
garden: garden,
|
'crop_name' => tomato.name,
|
||||||
crop: tomato,
|
'slug' => 'tomato-1',
|
||||||
owner: member),
|
'owner_name' => member.login_name,
|
||||||
FactoryBot.create(:planting,
|
'owner_slug' => member.slug
|
||||||
garden: garden,
|
},
|
||||||
crop: maize,
|
{
|
||||||
owner: garden.owner,
|
'crop_name' => maize.name,
|
||||||
description: '',
|
'slug' => 'maize',
|
||||||
planted_at: Time.zone.local(2013, 1, 13)),
|
'owner_name' => garden.owner.login_name,
|
||||||
FactoryBot.create(:planting,
|
'owner_slug' => garden.owner.slug,
|
||||||
garden: garden,
|
'planted_at' => Time.zone.local(2013, 1, 13)
|
||||||
owner: garden.owner,
|
},
|
||||||
crop: tomato,
|
{
|
||||||
planted_at: Time.zone.local(2013, 1, 13),
|
'crop_name' => tomato.name,
|
||||||
finished_at: Time.zone.local(2013, 1, 20),
|
'slug' => 'tomato-2',
|
||||||
finished: true)
|
'owner_name' => garden.owner.login_name,
|
||||||
|
'owner_slug' => garden.owner.slug,
|
||||||
|
'planted_at' => Time.zone.local(2013, 1, 13),
|
||||||
|
'finished_at' => Time.zone.local(2013, 1, 20),
|
||||||
|
'finished' => true
|
||||||
|
}
|
||||||
])
|
])
|
||||||
end
|
end
|
||||||
assign(:plantings, plantings)
|
assign(:plantings, plantings)
|
||||||
@@ -39,8 +44,8 @@ describe "plantings/index" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "renders a list of plantings" do
|
describe "renders a list of plantings" do
|
||||||
it { expect(rendered).to have_content tomato.name }
|
it { expect(rendered).to have_content 'tomato' }
|
||||||
it { expect(rendered).to have_content maize.name }
|
it { expect(rendered).to have_content 'maize' }
|
||||||
end
|
end
|
||||||
|
|
||||||
it "provides data links" do
|
it "provides data links" do
|
||||||
|
|||||||
Reference in New Issue
Block a user