0
실제로 로그인 버튼을 클릭하고 있습니다. 하지만 jquery/ajax를 사용하여 로그인을 처리하는 것은 아약스 호출이었습니다.이 문제를 해결하는 방법을 알려주세요. rspec으로 테스트하는 동안이 오류가 발생합니다.오류/오류 : click_button "로그인"ActionView :: MissingTemplate :
오류 :
Creating todos after login should show the left navigation on the dashboard
Failure/Error: click_button "Sign in"
ActionView::MissingTemplate:
Missing template sessions/create, application/create with {:locale=>[:en],
**spec/features/todos/create_spec.rb**
describe "Creating todos" do
let(:user) { FactoryGirl.create(:user)}
before(:each) do
visit root_path
click_link "Login"
fill_in "login_email", with: "[email protected]"
fill_in "password", with: "password"
click_button "Sign in"
end
describe "after login" do
it "should show the left navigation on the dashboard" do
visit employees_dashboard_path
page.should have_link('Todo', href: todos_path)
end
end
보기 양식 :
<div id="signinForm">
<%= form_tag sessions_url, remote: true do |f| %>
<div class="form-group">
<%= text_field_tag :email, "", placeholder: "Email", class: "form-control", id: "login_email", data: {errorkey: "email"} %>
</div>
<div class="form-group">
<%= password_field_tag :password, "", placeholder: "Password", class: "form-control", data: {errorkey: "password"} %>
</div>
<button type="submit" class="btn btn-block btn-primary">Sign in</button>
<% end %>
</div>