From 2948251fc293fc69757911c88542929cc470cd3e Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 21 Sep 2017 18:31:30 +0200 Subject: [PATCH] updates specs --- spec/features/communities_spec.rb | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/spec/features/communities_spec.rb b/spec/features/communities_spec.rb index 2909f416e..7cd3d814c 100644 --- a/spec/features/communities_spec.rb +++ b/spec/features/communities_spec.rb @@ -27,15 +27,6 @@ feature 'Communities' do expect(page).not_to have_selector(".button.disabled", text: "Create topic") end - scenario 'Should display disabled create topic button when user is not logged' do - proposal = create(:proposal) - community = proposal.community - - visit community_path(community) - - expect(page).to have_selector(".button.disabled", text: "Create topic") - end - scenario 'Should display without_topics_text and participants when there are not topics' do proposal = create(:proposal) community = proposal.community @@ -100,7 +91,7 @@ feature 'Communities' do expect(topic2.title).to appear_before(topic1.title) end - scenario 'Should display topic edit button when author is logged' do + scenario 'Should display topic edit button on topic show when author is logged' do proposal = create(:proposal) community = proposal.community user = create(:user) @@ -108,15 +99,11 @@ feature 'Communities' do topic2 = create(:topic, community: community) login_as(user) - visit community_path(community) + visit community_topic_path(community, topic1) + expect(page).to have_link("Edit topic", href: edit_community_topic_path(community, topic1)) - within "#topic_#{topic1.id}" do - expect(page).to have_link("Edit", href: edit_community_topic_path(community, topic1)) - end - - within "#topic_#{topic2.id}" do - expect(page).not_to have_link("Edit", href: edit_community_topic_path(community, topic2)) - end + visit community_topic_path(community, topic2) + expect(page).not_to have_link("Edit topic", href: edit_community_topic_path(community, topic2)) end scenario 'Should display participant when there is topics' do