Files
growstuff/spec/features/gardens/adding_gardens_spec.rb
2026-04-23 13:31:16 +00:00

28 lines
771 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
require 'custom_matchers'
describe "Gardens", :js do
context 'signed in' do
include_context 'signed in member'
before { visit new_garden_path }
it_behaves_like 'is accessible'
it "displays required and optional fields properly" do
expect(page).to have_css ".required", text: "Name"
expect(page).to have_css 'textarea#garden_description'
expect(page).to have_css 'input#garden_location'
expect(page).to have_css 'input#garden_area'
end
it "Create new garden" do
fill_in "Name", with: "New garden"
click_button "Save"
expect(page).to have_content "Garden was successfully created"
expect(page).to have_content "New garden"
end
end
end