0

これは合格します:

describe "log page" do
#let(:user) { FactoryGirl.create(:user) }
#let!(:m1) { FactoryGirl.create(:status_update, user: user ) }
#let!(:m2) { FactoryGirl.create(:status_update, user: user ) }

before { visit user_path(user) }

#it { should have_selector('h1', text: user.email) }
#it { should have_selector('title', text: user.email) }

#describe "logs" do
#  it { should have_content(m1.weight) }
#  it { should have_content(m2.weight) }
#  it { should have_content(user.status_updates.count) }
#end
end    

他のすべてのコメントを外すと、失敗します。

なぜこれが起こるのですか?私はそれを理解しようとして髪を引っ張ってきました。

4

1 に答える 1

3

一見すると、主題が抜けているように見えます。追加してみてください:

subject { page }

itブロックの前。

于 2012-08-19T07:51:12.057 に答える