Fix community topics specs
This commit is contained in:
@@ -24,7 +24,6 @@ feature 'Communities' do
|
||||
expect(page).to have_content proposal.title
|
||||
expect(page).to have_content "Participate in the community of this proposal"
|
||||
expect(page).to have_link("Create topic", href: new_community_topic_path(community))
|
||||
expect(page).not_to have_selector(".button.disabled", text: "Create topic")
|
||||
end
|
||||
|
||||
scenario 'Should display without_topics_text and participants when there are not topics' do
|
||||
|
||||
@@ -4,13 +4,16 @@ feature 'Topics' do
|
||||
|
||||
context 'New' do
|
||||
|
||||
scenario 'Should display disabled button to new topic page without user logged', :js do
|
||||
scenario 'Create new topic link should redirect to sign up for anonymous users', :js do
|
||||
proposal = create(:proposal)
|
||||
community = proposal.community
|
||||
|
||||
logout
|
||||
visit community_path(community)
|
||||
click_link "Create topic"
|
||||
|
||||
expect(page).to have_selector(".button.expanded.disabled")
|
||||
expect(page).to have_content "Sign in with:"
|
||||
expect(current_path).to eq(new_user_session_path)
|
||||
end
|
||||
|
||||
scenario 'Can access to new topic page with user logged', :js do
|
||||
@@ -34,8 +37,8 @@ feature 'Topics' do
|
||||
|
||||
click_link "Create topic"
|
||||
|
||||
expect(page).to have_content "Topic Title"
|
||||
expect(page).to have_content "Description"
|
||||
expect(page).to have_content "Title"
|
||||
expect(page).to have_content "Initial text"
|
||||
expect(page).to have_content "Recommendations to create a topic"
|
||||
expect(page).to have_content "Do not write the topic title or whole sentences in capital letters. On the internet that is considered shouting. And no one likes to be yelled at."
|
||||
expect(page).to have_content "Any topic or comment that implies an illegal action will be eliminated, also those that intend to sabotage the spaces of the subject, everything else is allowed."
|
||||
@@ -128,9 +131,9 @@ feature 'Topics' do
|
||||
user = create(:user)
|
||||
topic = create(:topic, community: community, author: user)
|
||||
login_as(user)
|
||||
visit community_path(community)
|
||||
visit community_topic_path(community, topic)
|
||||
|
||||
click_link "Destroy"
|
||||
click_link "Destroy topic"
|
||||
|
||||
expect(page).to have_content "Topic deleted successfully."
|
||||
expect(page).not_to have_content topic.title
|
||||
|
||||
Reference in New Issue
Block a user