docbrown/spec/routing/i18n_routes_spec.rb
Mac Siri 842e6880b8
Routine rubocop fix on /spec (#19217)
* Softrun rubocop

* Hardrun rubocop (-A)

* Change a rubocop rule

* Add missing cops

* Undo & redo rubocop -A
2023-03-21 09:55:26 -04:00

34 lines
843 B
Ruby

require "rails_helper"
RSpec.describe "i8n routes" do
let(:locale) { "fr-ca" }
let(:i18n_route) { "/locale/#{locale}" }
let(:user) { create(:user) }
it "renders a user index if there is a user with the username successfully" do
expect(get: "#{i18n_route}/#{user.username}").to route_to(
controller: "stories",
action: "index",
username: user.username,
locale: "fr-ca",
)
end
it "renders a user's story successfully" do
expect(get: "#{i18n_route}/ben/this-is-a-slug").to route_to(
controller: "stories",
action: "show",
slug: "this-is-a-slug",
username: "ben",
locale: "fr-ca",
)
end
it "renders homepage successfully" do
expect(get: i18n_route).to route_to(
controller: "stories",
action: "index",
locale: "fr-ca",
)
end
end