0
난 정말 당신이 날이 리팩토링 도움이 될 희망
:리팩토링 자원 사양, 그룹 다른 역할 (RSpec에 레일)에 원하는
context "a deactivated resource" do
before(:each)
@resource = FactoryGirl.create(:deactivatedresource)
end
it "does not show in the search (as registred User)" do
as_user # does the log in
visit path_to_search_page
page.should_not have_content @resource.name
end
it "is visible to the resource owner" do
as_resource_owner(@resource)
visit path_to_search_page
page.should_have content @resource.name
end
it "as unregistred user" do
as_unregistred_user # checks for log out and logs out if necessary
visit path_to_search_page
page.should_not have_content @resource.name
end
정말 여분 after(:each)
블록 엉에 visit
및 should(not) have
부분을 넣어 싶습니다 , 그러나 이것은 불쾌한 결과를 만든다. 어떻게 하시겠습니까?