Add active_language controller and cookie storage

This commit is contained in:
maddiebaka
2023-10-27 15:24:48 -04:00
parent c2891a66f8
commit 3ba4a49a26
8 changed files with 89 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the ActiveLanguageHelper. For example:
#
# describe ActiveLanguageHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
RSpec.describe ActiveLanguageHelper, type: :helper do
describe "active_language_helper_tag" do
before :each do
english = FactoryBot.create(:language_english)
2.times { FactoryBot.create(:language) }
@tag = active_language_select_tag
end
it "should return a select tag" do
expect(@tag).to have_selector(%(select))
end
it "should not contain an English option" do
expect(@tag).to_not include("English")
end
end
end