Testing RSpec:如何使用重音编写测试?
我是cucumber和rspec的新手,我正在尝试测试一个文本为“Regístrate”的按钮(看看重音“í”) 在我的应用程序中,我有很多用西班牙语编写的控件,带有重音。但是我犯了一个错误,因为这些元音带有重音。我相信有一个简单的解决方案,但我没有找到一个解决方案 我可以更改测试描述,但不能更改用户应用程序中的文字。。。有什么建议吗Testing RSpec:如何使用重音编写测试?,testing,rspec,cucumber,Testing,Rspec,Cucumber,我是cucumber和rspec的新手,我正在尝试测试一个文本为“Regístrate”的按钮(看看重音“í”) 在我的应用程序中,我有很多用西班牙语编写的控件,带有重音。但是我犯了一个错误,因为这些元音带有重音。我相信有一个简单的解决方案,但我没有找到一个解决方案 我可以更改测试描述,但不能更改用户应用程序中的文字。。。有什么建议吗 describe "signup" do before { visit signup_path } let(:submit) { "Regístrat
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
错误:
user_signup_steps.rb:3: syntax error, unexpected $end, expecting keyword_end
"Regístrate"
^ (SyntaxError)
看起来像是编码错误。尝试将此行添加到等级库文件的顶部:
# encoding: utf-8