sto ottenendo una pagina vuota come risposta quando si esegue il seguente test RSpec:Ottenere pagina vuota quando l'esecuzione di test RSpec per get 'nuovo'
require 'spec_helper'
describe FriendshipsController do
include Devise::TestHelpers
render_views
before(:each) do
@user = User.create!(:email => "[email protected]", :password => "mustermann", :password_confirmation => "mustermann")
@friend = User.create!(:email => "[email protected]", :password => "password", :password_confirmation => "password")
sign_in @user
end
describe "GET 'new'" do
it "should be successful" do
get 'new', :user_id => @user.id
response.should be_success
end
it "should show all registered users on Friendslend, except the logged in user" do
get 'new', :user_id => @user.id
page.should have_select("Add new friend")
page.should have_content("div.users")
page.should have_selector("div.users li", :count => 1)
end
it "should not contain the logged in user" do
get 'new', :user_id => @user.id
response.should_not have_content(@user.email)
end
end
end
ho solo una pagina vuota quando si esegue il test RSpec. Con la pagina vuota intendo che non ci sono altri contenuti HTML oltre alla dichiarazione DOCTYPE.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
È interessante notare che i test RSPec per post "creare" funzionano correttamente. Qualche suggerimento?
Sto usando Rails 3.2 con rotaie specifiche, cetrioli e capibara (invece di webrat).
Sono curioso, hai mai trovato una soluzione a questo problema? – voxobscuro
anche curioso di una soluzione a questo .. – jay
Purtroppo non ho ancora una soluzione ... –