From 72e348cdf63fb2adb10b4b45da4a24a0e51d0da5 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 19 Nov 2019 14:16:50 +1300 Subject: [PATCH] Fix up specs --- app/views/gardens/index.html.haml | 1 - app/views/layouts/_nav.haml | 2 +- spec/features/gardens/actions_spec.rb | 2 +- spec/features/seeds/misc_seeds_spec.rb | 4 +++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/gardens/index.html.haml b/app/views/gardens/index.html.haml index ec79a368a..a36d5e35f 100644 --- a/app/views/gardens/index.html.haml +++ b/app/views/gardens/index.html.haml @@ -1,6 +1,5 @@ - content_for :title, @owner ? "#{@owner}'s gardens" : "Everyone's gardens" - %h1= @owner ? "#{@owner}'s gardens" : "Everyone's gardens" = render 'layouts/nav', model: Garden diff --git a/app/views/layouts/_nav.haml b/app/views/layouts/_nav.haml index 4b835a626..f363b0aac 100644 --- a/app/views/layouts/_nav.haml +++ b/app/views/layouts/_nav.haml @@ -1,5 +1,5 @@ - if current_member.present? - .card + .card.button-bar .card-header %h2.card-title #{model} links = link_to url_for([current_member, model]), class: 'btn' do diff --git a/spec/features/gardens/actions_spec.rb b/spec/features/gardens/actions_spec.rb index 0dbfe1882..74fc10803 100644 --- a/spec/features/gardens/actions_spec.rb +++ b/spec/features/gardens/actions_spec.rb @@ -12,7 +12,7 @@ describe "Gardens" do describe '#index' do shared_examples "has buttons bar at top" do it "has buttons bar at top" do - within '.nav' do + within '.button-bar' do expect(subject).to have_link 'Add a garden' expect(subject).to have_link 'My gardens' expect(subject).to have_link "Everyone's gardens" diff --git a/spec/features/seeds/misc_seeds_spec.rb b/spec/features/seeds/misc_seeds_spec.rb index a1d047daf..0aa54f128 100644 --- a/spec/features/seeds/misc_seeds_spec.rb +++ b/spec/features/seeds/misc_seeds_spec.rb @@ -30,7 +30,9 @@ describe "seeds", js: true do describe "Clicking link to owner's profile" do before do visit member_seeds_path(member) - click_link "View Owners Profile" + within '.login-name' do + click_link member.login_name + end end it { expect(current_path).to eq member_path(member) }