From f39af27538d5612ccdb40a7ccff8030ee343e30b Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 23 Jan 2019 16:25:01 +1300 Subject: [PATCH] Seperate some specs --- spec/features/crops/crop_wranglers_spec.rb | 10 +++++----- .../features/plantings/planting_a_crop_spec.rb | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/spec/features/crops/crop_wranglers_spec.rb b/spec/features/crops/crop_wranglers_spec.rb index eafc7039f..86dc8a1c0 100644 --- a/spec/features/crops/crop_wranglers_spec.rb +++ b/spec/features/crops/crop_wranglers_spec.rb @@ -32,11 +32,11 @@ feature "crop wranglers", js: true do end end - scenario "visiting a crop can see wrangler links" do - visit crop_path(crops.first) - expect(page).to have_content 'You are a CROP WRANGLER' - expect(page).to have_link 'Edit crop' - expect(page).to have_link 'Delete crop' + describe "visiting a crop can see wrangler links" do + before { visit crop_path(crops.first) } + it { expect(page).to have_content 'You are a CROP WRANGLER' } + it { expect(page).to have_link 'Edit' } + it { expect(page).to have_link 'Delete' } end scenario "can create a new crop" do diff --git a/spec/features/plantings/planting_a_crop_spec.rb b/spec/features/plantings/planting_a_crop_spec.rb index de966b2fe..376c42569 100644 --- a/spec/features/plantings/planting_a_crop_spec.rb +++ b/spec/features/plantings/planting_a_crop_spec.rb @@ -21,15 +21,15 @@ feature "Planting a crop", :js, :elasticsearch do expect(page).to have_content "* denotes a required field" end - it "displays required and optional fields properly" do - expect(page).to have_selector ".form-group.required", text: "What did you plant?" - expect(page).to have_selector ".form-group.required", text: "Where did you plant it?" - expect(page).to have_optional 'input#planting_planted_at' - expect(page).to have_optional 'input#planting_quantity' - expect(page).to have_optional 'select#planting_planted_from' - expect(page).to have_optional 'select#planting_sunniness' - expect(page).to have_optional 'textarea#planting_description' - expect(page).to have_optional 'input#planting_finished_at' + describe "displays required and optional fields properly" do + it { expect(page).to have_selector ".form-group.required", text: "What did you plant?" } + it { expect(page).to have_selector ".form-group.required", text: "Where did you plant it?" } + it { expect(page).to have_optional 'input#planting_planted_at' } + it { expect(page).to have_optional 'input#planting_quantity' } + it { expect(page).to have_optional 'select#planting_planted_from' } + it { expect(page).to have_optional 'select#planting_sunniness' } + it { expect(page).to have_optional 'textarea#planting_description' } + it { expect(page).to have_optional 'input#planting_finished_at' } end scenario "Creating a new planting" do