Test updates

This commit is contained in:
Brenda Wallace
2019-03-29 11:28:17 +13:00
parent e4d4cdc3fa
commit 830b554dc9
4 changed files with 23 additions and 28 deletions

View File

@@ -4,18 +4,23 @@ shared_examples "append date" do
background { visit path }
scenario "Selecting a date with datepicker" do
describe "Selecting a date with datepicker" do
before do
click_link link_text
within "div.datepicker" do
expect(page).to have_content this_month.to_s
find(".datepicker-days td.day", text: "21").click
within "div.datepicker" do
expect(page).to have_content this_month.to_s
find(".datepicker-days td.day", text: "21").click
end
end
expect(page).to have_content "Finished: #{this_month} 21, #{this_year}"
it { expect(page).to have_content "Finished" }
it { expect(page).to have_content "21 #{this_month}" }
end
scenario "Confirming without selecting date" do
click_link link_text
click_link "Confirm without date"
expect(page).to have_content("Finished")
describe "Confirming without selecting date" do
before do
click_link link_text
click_link "Confirm without date"
end
it { expect(page).to have_content("Finished") }
end
end

View File

@@ -7,7 +7,7 @@ describe HarvestsHelper do
quantity: nil,
weight_quantity: nil)
result = helper.display_quantity(harvest)
result.should eq 'not specified'
result.should eq ''
end
it '3 individual' do

View File

@@ -6,7 +6,7 @@ describe SeedsHelper do
seed = FactoryBot.create(:seed,
description: nil)
result = helper.display_seed_description(seed)
expect(result).to eq ""
expect(result).to eq "no description provided."
end
it "is less than 130 characters long" do

View File

@@ -1,10 +1,10 @@
require 'rails_helper'
describe "plantings/index" do
let(:member) { FactoryBot.create(:member) }
let(:garden) { FactoryBot.create(:garden, owner: member) }
let(:tomato) { FactoryBot.create(:tomato) }
let(:maize) { FactoryBot.create(:maize) }
let(:member) { FactoryBot.create(:member) }
let(:garden) { FactoryBot.create(:garden, owner: member) }
let(:tomato) { FactoryBot.create(:tomato, name: 'tomato') }
let(:maize) { FactoryBot.create(:maize, name: 'maize') }
before do
controller.stub(:current_user) { nil }
@@ -36,19 +36,9 @@ describe "plantings/index" do
render
end
it "renders a list of plantings" do
rendered.should have_content tomato.name
rendered.should have_content maize.name
rendered.should have_content member.login_name
rendered.should have_content garden.name
end
it "displays planting time" do
rendered.should have_content 'January 13, 2013'
end
it "displays finished time" do
rendered.should have_content 'January 20, 2013'
describe "renders a list of plantings" do
it { expect(rendered).to have_content tomato.name }
it { expect(rendered).to have_content maize.name }
end
it "provides data links" do