1
각도기의 시나리오를 카피 바라에서 가능한 것처럼 그룹화하는 방법이 있는지 궁금합니다.각도기의 시나리오를 컨텍스트로 그룹화하는 방법이 있습니까?
예를 들어 사생활 보호 설정 테스트를 작성한 경우 로그인하지 않은 사용자의 컨텍스트와 사용자 간의 관계에 따라 다른 시나리오로 구분되는 로그인 한 사용자의 컨텍스트를 가질 수 있습니다. 또 다른 예 :
feature 'allows user to share' do
let!(:post) { create :post }
before do
create :feed_post, user: user, post: post
app.sign_in user
end
context 'with comment' do
subject { feed.share_modal }
before { feed.posts.first.share_post }
scenario { is_expected.to have_content t('social_sharing.new.title') }
scenario { is_expected.to have_button t('social_sharing.new.action') }
context 'sharing with a comment' do
before do
feed.share_modal.comment_on_share 'a nice comment'
feed.share_modal.submit_share_form
feed.wait_until_share_modal_invisible
end
scenario 'closes the modal' do
expect(feed).to have_no_share_modal
end
scenario 'shows shared message' do
expect(feed.posts.first)
.to have_content "#{user.name} shared #{post.user.name.possessive} post"
expect(feed.posts.first).to have_content 'a nice comment'
end
end
end
end
상황에 내가 컨텍스트 내 시나리오 반복하는 단계가 포함되어 내부 블록 전에를 추가 할 수 있기 때문에 나를, 사양은 DRY 만들 수 있습니다. 각도기로도 가능합니까?
[specs vs suites] (http://stackoverflow.com/questions/30331018/suites-vs-specs-protractor)를 요청할 수 있습니까? – alecxe