今私は編集アクションをテストしようとしている機能テストを書いています。私はRSpecを通常どおり実行するときに何が期待されているのか分からないので、ちょっと奇妙です。save_and_open_pageコマンドを使用すると、実際にブラウザに期待していることが示されます。私はこれがセレンの問題だと思うが、私はrspecの新人だし、わからない。私は "睡眠"や "一時停止"を使用するように提案されているが、私はこれらの方法を使用する方法がわからないし、その上に良いドキュメントを見つけることができない。誰かが私の現在のコードでこれを使用する有効な方法を表示できるかどうか疑問に思っていますか?RSpecスリープを呼び出す
TEST
require "rails_helper"
RSpec.feature "Edit 'Bounce Back' Message", :type => :feature do
given!(:group) { Group.create!(name: "Group A", response: "You are now subscribed for updates") }
scenario "Staff can see the response messages" do
visit "/groups"
user = FactoryGirl.create(:user)
fill_in "Email", with: user.email
fill_in "Password", with: user.password
click_button "Sign in"
expect(page).to have_content("You are now subscribed for updates")
expect(page).to have_content("Group a")
end
scenario "Staff can edit the response messages" do
visit "/groups/#{group.id}/edit"
user = FactoryGirl.create(:user)
fill_in "Email", with: user.email
fill_in "Password", with: user.password
click_button "Sign in"
expect(page).to have_content("You have now subscribed for updates")
end
end
私は、これはあなたがより多くを必要とするなら、私に知らせてください十分な情報であると思います。ありがとうございました! 私もrspec_waitを使ってみましたが、まだエラーが出ています。ここでは、この問題のために、現在受け入れ答えが間違っている
<div class="container text-center">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 well">
<%= form_for @group do |form| %>
<div class="form-group">
<%= form.label :body, "Edit The Response:", class: "message_label"%>
<%= form.text_field :response, class: "form-control", placeholder: "New things are happening!" %>
</div>
<%= form.submit "Update", class: "btn btn-primary" %>
<% end %>
</div>
</div>
</div>
寝ないでください。カピバラがあなたを待つようにしなさい。あなたの例は私には似合います。彼らはどこで失敗するのですか? –