Retrospring/spec/views/navigation/_guest.html.haml_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
694 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require "rails_helper"
describe "navigation/_guest.html.haml", type: :view do
subject(:rendered) do
render partial: "navigation/guest"
end
context "registrations are enabled" do
before do
allow(APP_CONFIG).to receive(:dig).with(:features, :registration, :enabled).and_return(true)
end
it "has a sign up link" do
expect(rendered).to match(/Sign up/)
end
end
context "registrations are disabled" do
before do
allow(APP_CONFIG).to receive(:dig).with(:features, :registration, :enabled).and_return(false)
end
it "has no sign up link" do
expect(rendered).to_not match(/Sign up/)
end
end
end