mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-29 19:26:30 -04:00
28 lines
771 B
Ruby
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
|