I’m new in cucumber and rspec, and I’m trying to test a button whose text is “Regístrate” (look at the accent “í”).
In my app, I have a lot of controls written in spanish, with accents á é í ó ú. But I get an error because of these vowels with accents. I’m sure there is an easy solution but I don’t achieve to find a solution.
I could change the tests descriptions, but not the words in the user application… any suggestion?
describe "signup" do
before { visit signup_path }
let(:submit) { "Regístrate" }
describe "con información válida" do
it "no debería crear el usuario" do
expect { click_button submit }.not_to change(User, :count)
end
end
describe "con información válida" do
before do
fill_in "Nombre", with: "Example User"
fill_in "Email", with: "user@example.com"
fill_in "Password", with: "foobar"
fill_in "Confirmación", with: "foobar"
end
it "debería crear el usuario" do
expect { click_button submit }.to change(User, :count).by(1)
end
end
end
error:
user_signup_steps.rb:3: syntax error, unexpected $end, expecting keyword_end
"Regístrate"
^ (SyntaxError)
Looks like an encoding error. Try adding this line to the top of the spec file: