Я пытаюсь протестировать регистрацию пользователя.использование rails + devise 1.1.rc2 У меня есть этот тест:
Given I am on the landing page
When I go to the registration page
And I fill in "Firstname" with "F"
And I fill in "Lastname" with "L"
And I fill in "Country" with "C"
And I fill in "State" with "S"
And I fill in "City" with "C"
And I fill in "Email" with "me@gmail.com"
And I fill in "Password" with "password"
And I fill in "Password Confirmation" with "password"
And I press "Register"
Then I should see "You have registered successfully. If enabled, a confirmation was sent your e-mail."
Это фрагмент ошибки:
expected the following element's content to include "You have registered successfully. If enabled, a confirmation was sent your e-mail.":
You are being redirected. (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/web_steps.rb:145:in `/^(?:|I )should see "([^"]*)"$/'
features/registration.feature:42:in `Then I should see "You have registered successfully. If enabled, a confirmation was sent your e-mail."
Я думаю, что это связано с редиректом, не знаю какчтобы исправить это?Но в моем app_controller.rb у меня есть это, так что пользователь попадает на страницу панели инструментов ...
def after_sign_in_path_for(resource_or_scope)
"/dashboard"
end
это просто тест, который не проходит, фактическая функциональность регистрации в порядке.