Updated feature spec to look for new annual/perennial text

This commit is contained in:
Brenda Wallace
2017-11-05 14:07:33 +13:00
parent eb585611fe
commit ec00baef0d

View File

@@ -173,18 +173,18 @@ feature "crop detail page", js: true do
before { visit crop_path(crop) }
context 'crop is an annual' do
let(:crop) { FactoryBot.create :annual_crop }
it { expect(page).to have_text 'annual (living and reproducing in a single year or less)' }
it { expect(page).not_to have_text 'perennial (living more than two years) ' }
it { expect(page).to have_text 'annual crop (living and reproducing in a single year or less)' }
it { expect(page).not_to have_text 'perennial crop (living more than two years)' }
end
context 'crop is perennial' do
let(:crop) { FactoryBot.create :perennial_crop }
it { expect(page).to have_text 'perennial (living more than two years) ' }
it { expect(page).not_to have_text 'annual (living and reproducing in a single year or less)' }
it { expect(page).to have_text 'perennial crop (living more than two years)' }
it { expect(page).not_to have_text 'annual crop (living and reproducing in a single year or less)' }
end
context 'crop perennial value is null' do
let(:crop) { FactoryBot.create :crop, perennial: nil }
it { expect(page).not_to have_text 'perennial (living more than two years) ' }
it { expect(page).not_to have_text 'annual (living and reproducing in a single year or less)' }
it { expect(page).not_to have_text 'perennial crop (living more than two years)' }
it { expect(page).not_to have_text 'annual crop (living and reproducing in a single year or less)' }
end
end
end