Files
growstuff/spec/views/members/_location.html.haml_spec.rb
Daniel O'Connor f1acb35520 Merge pull request #4537 from Growstuff/FactoryBot/SyntaxMethods
Rubocop: FactoryBot/SyntaxMethods
2026-04-23 22:29:24 +09:30

35 lines
795 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
describe "members/_location" do
context "member with location" do
let(:member) { create(:london_member) }
before { render partial: 'members/location', locals: { member: } }
it 'shows location if available' do
expect(rendered).to have_content member.location
end
it "links to the places page" do
assert_select "a", href: place_path(member.location)
end
end
context "member with no location" do
before do
member = create(:member)
render partial: 'members/location', locals: { member: }
end
it 'shows unknown location' do
expect(rendered).to have_content "unknown location"
end
it "doesn't link anywhere" do
assert_select "a", false
end
end
end