From 287c48873456045766bf4f0cc0619348a5eaa220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 29 Mar 2021 13:49:09 +0200 Subject: [PATCH] Use JavaScripts in tests using CKEditor We were filling in textareas, so we were only testing how the application behaves for about 1%-2% of our users. --- spec/support/common_actions.rb | 2 +- spec/support/common_actions/emails.rb | 2 +- spec/system/admin/budget_investments_spec.rb | 4 +-- spec/system/admin/dashboard/actions_spec.rb | 4 +-- spec/system/admin/emails/newsletters_spec.rb | 6 ++-- .../poll/questions/answers/answers_spec.rb | 8 ++--- .../admin/site_customization/pages_spec.rb | 5 +-- spec/system/budgets/investments_spec.rb | 8 ++--- spec/system/debates_spec.rb | 16 ++++----- spec/system/emails_spec.rb | 8 ++--- .../management/budget_investments_spec.rb | 4 +-- spec/system/management/proposals_spec.rb | 4 +-- spec/system/proposals_spec.rb | 34 +++++++++---------- spec/system/tags/budget_investments_spec.rb | 12 +++---- spec/system/tags/debates_spec.rb | 12 +++---- spec/system/tags/proposals_spec.rb | 12 +++---- spec/system/tags_spec.rb | 8 ++--- 17 files changed, 75 insertions(+), 74 deletions(-) diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index 68542dbf512..954047d9a7c 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -35,7 +35,7 @@ def validate_officer def fill_in_proposal fill_in "Proposal title", with: "Help refugees" fill_in "Proposal summary", with: "In summary, what we want is..." - fill_in "Proposal text", with: "This is very important because..." + fill_in_ckeditor "Proposal text", with: "This is very important because..." fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yPQfcG-eimk" fill_in "proposal_responsible_name", with: "Isabel Garcia" check "proposal_terms_of_service" diff --git a/spec/support/common_actions/emails.rb b/spec/support/common_actions/emails.rb index e713cdfdcf4..01c83c4316d 100644 --- a/spec/support/common_actions/emails.rb +++ b/spec/support/common_actions/emails.rb @@ -21,6 +21,6 @@ def fill_in_newsletter_form(options = {}) fill_in "Subject", with: (options[:subject] || "This is a different subject") fill_in "E-mail address that will appear as sending the newsletter", with: (options[:from] || "no-reply@consul.dev") - fill_in "Email content", with: (options[:body] || "This is a different body") + fill_in_ckeditor "Email content", with: (options[:body] || "This is a different body") end end diff --git a/spec/system/admin/budget_investments_spec.rb b/spec/system/admin/budget_investments_spec.rb index de5004fa946..a30616a7dc8 100644 --- a/spec/system/admin/budget_investments_spec.rb +++ b/spec/system/admin/budget_investments_spec.rb @@ -1034,7 +1034,7 @@ end context "Edit" do - scenario "Change title, incompatible, description or heading" do + scenario "Change title, incompatible, description or heading", :js do budget_investment = create(:budget_investment, :incompatible) create(:budget_heading, group: budget_investment.group, name: "Barbate") @@ -1042,7 +1042,7 @@ click_link "Edit" fill_in "Title", with: "Potatoes" - fill_in "Description", with: "Carrots" + fill_in_ckeditor "Description", with: "Carrots" select "#{budget_investment.group.name}: Barbate", from: "budget_investment[heading_id]" uncheck "budget_investment_incompatible" check "budget_investment_selected" diff --git a/spec/system/admin/dashboard/actions_spec.rb b/spec/system/admin/dashboard/actions_spec.rb index e6d6e175e77..5032d3e0c10 100644 --- a/spec/system/admin/dashboard/actions_spec.rb +++ b/spec/system/admin/dashboard/actions_spec.rb @@ -46,9 +46,9 @@ click_link "Create resource or action" end - scenario "Creates a new action" do + scenario "Creates a new action", :js do fill_in "Title", with: action.title - fill_in "Description", with: action.description + fill_in_ckeditor "Description", with: action.description click_button "Save" diff --git a/spec/system/admin/emails/newsletters_spec.rb b/spec/system/admin/emails/newsletters_spec.rb index 8f3f0e31502..05bc3f7d89e 100644 --- a/spec/system/admin/emails/newsletters_spec.rb +++ b/spec/system/admin/emails/newsletters_spec.rb @@ -58,7 +58,7 @@ end end - scenario "Create" do + scenario "Create", :js do visit admin_newsletters_path click_link "New newsletter" @@ -76,7 +76,7 @@ expect(page).to have_content "This is a body" end - scenario "Update" do + scenario "Update", :js do newsletter = create(:newsletter) visit admin_newsletters_path @@ -161,7 +161,7 @@ end end - scenario "Select list of users to send newsletter" do + scenario "Select list of users to send newsletter", :js do UserSegments::SEGMENTS.each do |user_segment| visit new_admin_newsletter_path diff --git a/spec/system/admin/poll/questions/answers/answers_spec.rb b/spec/system/admin/poll/questions/answers/answers_spec.rb index 8b26fdb03f2..70e526e3413 100644 --- a/spec/system/admin/poll/questions/answers/answers_spec.rb +++ b/spec/system/admin/poll/questions/answers/answers_spec.rb @@ -1,14 +1,14 @@ require "rails_helper" describe "Answers", :admin do - scenario "Create" do + scenario "Create", :js do question = create(:poll_question) visit admin_question_path(question) click_link "Add answer" fill_in "Answer", with: "The answer is always 42" - fill_in "Description", with: "The Hitchhiker's Guide To The Universe" + fill_in_ckeditor "Description", with: "The Hitchhiker's Guide To The Universe" click_button "Save" @@ -16,7 +16,7 @@ expect(page).to have_content "The Hitchhiker's Guide To The Universe" end - scenario "Create second answer and place after the first one" do + scenario "Create second answer and place after the first one", :js do question = create(:poll_question) create(:poll_question_answer, title: "First", question: question, given_order: 1) @@ -24,7 +24,7 @@ click_link "Add answer" fill_in "Answer", with: "Second" - fill_in "Description", with: "Description" + fill_in_ckeditor "Description", with: "Description" click_button "Save" diff --git a/spec/system/admin/site_customization/pages_spec.rb b/spec/system/admin/site_customization/pages_spec.rb index 39edcbf6946..5230c3d2136 100644 --- a/spec/system/admin/site_customization/pages_spec.rb +++ b/spec/system/admin/site_customization/pages_spec.rb @@ -29,10 +29,11 @@ end context "Create" do - scenario "Valid custom page" do + scenario "Valid custom page", :js do visit admin_root_path within("#side_menu") do + click_link "Site content" click_link "Custom pages" end @@ -44,7 +45,7 @@ fill_in "Title", with: "An example custom page" fill_in "Subtitle", with: "Page subtitle" fill_in "site_customization_page_slug", with: "example-page" - fill_in "Content", with: "This page is about..." + fill_in_ckeditor "Content", with: "This page is about..." click_button "Create Custom page" diff --git a/spec/system/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb index 1acbd660b97..46349629e22 100644 --- a/spec/system/budgets/investments_spec.rb +++ b/spec/system/budgets/investments_spec.rb @@ -518,7 +518,7 @@ def investments_order expect(page).to have_current_path(budget_investments_path(budget)) end - scenario "Create budget investment too fast" do + scenario "Create budget investment too fast", :js do allow(InvisibleCaptcha).to receive(:timestamp_threshold).and_return(Float::INFINITY) login_as(author) @@ -526,7 +526,7 @@ def investments_order select heading.name, from: "budget_investment_heading_id" fill_in "Title", with: "I am a bot" - fill_in "Description", with: "This is the description" + fill_in_ckeditor "Description", with: "This is the description" check "budget_investment_terms_of_service" click_button "Create Investment" @@ -535,14 +535,14 @@ def investments_order expect(page).to have_current_path(new_budget_investment_path(budget)) end - scenario "Create" do + scenario "Create", :js do login_as(author) visit new_budget_investment_path(budget) select heading.name, from: "budget_investment_heading_id" fill_in "Title", with: "Build a skyscraper" - fill_in "Description", with: "I want to live in a high tower over the clouds" + fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds" fill_in "budget_investment_location", with: "City center" fill_in "budget_investment_organization_name", with: "T.I.A." fill_in "budget_investment_tag_list", with: "Towers" diff --git a/spec/system/debates_spec.rb b/spec/system/debates_spec.rb index b32dc4c8423..ec21f62045f 100644 --- a/spec/system/debates_spec.rb +++ b/spec/system/debates_spec.rb @@ -201,13 +201,13 @@ expect(page).to have_content("-6 votes") end - scenario "Create" do + scenario "Create", :js do author = create(:user) login_as(author) visit new_debate_path fill_in "Debate title", with: "A title for a debate" - fill_in "Initial debate text", with: "This is very important because..." + fill_in_ckeditor "Initial debate text", with: "This is very important because..." check "debate_terms_of_service" click_button "Start a debate" @@ -236,7 +236,7 @@ expect(page).to have_current_path(debates_path) end - scenario "Create debate too fast" do + scenario "Create debate too fast", :js do allow(InvisibleCaptcha).to receive(:timestamp_threshold).and_return(Float::INFINITY) author = create(:user) @@ -244,7 +244,7 @@ visit new_debate_path fill_in "Debate title", with: "I am a bot" - fill_in "Initial debate text", with: "This is the description" + fill_in_ckeditor "Initial debate text", with: "This is the description" check "debate_terms_of_service" click_button "Start a debate" @@ -281,13 +281,13 @@ expect(page.html).not_to include "<p>This is" end - scenario "Autolinking is applied to description" do + scenario "Autolinking is applied to description", :js do author = create(:user) login_as(author) visit new_debate_path fill_in "Debate title", with: "Testing auto link" - fill_in "Initial debate text", with: "

This is a link www.example.org

" + fill_in_ckeditor "Initial debate text", with: "This is a link www.example.org" check "debate_terms_of_service" click_button "Start a debate" @@ -347,7 +347,7 @@ expect(page).to have_content "You do not have permission to" end - scenario "Update should be posible for the author of an editable debate" do + scenario "Update should be posible for the author of an editable debate", :js do debate = create(:debate) login_as(debate.author) @@ -355,7 +355,7 @@ expect(page).to have_current_path(edit_debate_path(debate)) fill_in "Debate title", with: "End child poverty" - fill_in "Initial debate text", with: "Let's do something to end child poverty" + fill_in_ckeditor "Initial debate text", with: "Let's do something to end child poverty" click_button "Save changes" diff --git a/spec/system/emails_spec.rb b/spec/system/emails_spec.rb index 83705376b11..5aa3be7ac29 100644 --- a/spec/system/emails_spec.rb +++ b/spec/system/emails_spec.rb @@ -342,13 +342,13 @@ let(:budget) { create(:budget) } let!(:heading) { create(:budget_heading, name: "More hospitals", budget: budget) } - scenario "Investment created" do + scenario "Investment created", :js do login_as(author) visit new_budget_investment_path(budget_id: budget.id) select heading.name, from: "budget_investment_heading_id" fill_in "Title", with: "Build a hospital" - fill_in "Description", with: "We have lots of people that require medical attention" + fill_in_ckeditor "Description", with: "We have lots of people that require medical attention" check "budget_investment_terms_of_service" click_button "Create Investment" @@ -464,7 +464,7 @@ end context "Newsletter", :admin do - scenario "Send newsletter email to selected users" do + scenario "Send newsletter email to selected users", :js do user_with_newsletter_in_segment_1 = create(:user, :with_proposal, newsletter: true) user_with_newsletter_in_segment_2 = create(:user, :with_proposal, newsletter: true) user_with_newsletter_not_in_segment = create(:user, newsletter: true) @@ -476,7 +476,7 @@ expect(page).to have_content "Newsletter created successfully" - click_link "Send" + accept_confirm { click_link "Send" } expect(page).to have_content "Newsletter sent successfully" diff --git a/spec/system/management/budget_investments_spec.rb b/spec/system/management/budget_investments_spec.rb index c5fa459c13c..91fa375f10a 100644 --- a/spec/system/management/budget_investments_spec.rb +++ b/spec/system/management/budget_investments_spec.rb @@ -33,7 +33,7 @@ context "Create" do before { heading.budget.update(phase: "accepting") } - scenario "Creating budget investments on behalf of someone, selecting a budget" do + scenario "Creating budget investments on behalf of someone, selecting a budget", :js do user = create(:user, :level_two) login_managed_user(user) @@ -52,7 +52,7 @@ select "Health", from: "budget_investment_heading_id" fill_in "Title", with: "Build a park in my neighborhood" - fill_in "Description", with: "There is no parks here..." + fill_in_ckeditor "Description", with: "There is no parks here..." fill_in "budget_investment_location", with: "City center" fill_in "budget_investment_organization_name", with: "T.I.A." fill_in "budget_investment_tag_list", with: "green" diff --git a/spec/system/management/proposals_spec.rb b/spec/system/management/proposals_spec.rb index b9e982e27f4..4cb967530e0 100644 --- a/spec/system/management/proposals_spec.rb +++ b/spec/system/management/proposals_spec.rb @@ -6,7 +6,7 @@ end context "Create" do - scenario "Creating proposals on behalf of someone" do + scenario "Creating proposals on behalf of someone", :js do user = create(:user, :level_two) login_managed_user(user) @@ -21,7 +21,7 @@ fill_in "Proposal title", with: "Help refugees" fill_in "Proposal summary", with: "In summary, what we want is..." - fill_in "Proposal text", with: "This is very important because..." + fill_in_ckeditor "Proposal text", with: "This is very important because..." fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yRYFKcMa_Ek" check "proposal_terms_of_service" diff --git a/spec/system/proposals_spec.rb b/spec/system/proposals_spec.rb index 177f1ee551c..d7c85e0eb5c 100644 --- a/spec/system/proposals_spec.rb +++ b/spec/system/proposals_spec.rb @@ -357,7 +357,7 @@ expect(page).to have_css "meta[property='og:title'][content=\'#{proposal.title}\']", visible: :hidden end - scenario "Create and publish" do + scenario "Create and publish", :js do author = create(:user) login_as(author) @@ -365,7 +365,7 @@ fill_in "Proposal title", with: "Help refugees" fill_in "Proposal summary", with: "In summary, what we want is..." - fill_in "Proposal text", with: "This is very important because..." + fill_in_ckeditor "Proposal text", with: "This is very important because..." fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yPQfcG-eimk" fill_in "proposal_responsible_name", with: "Isabel Garcia" fill_in "proposal_tag_list", with: "Refugees, Solidarity" @@ -411,7 +411,7 @@ expect(page).to have_current_path(proposals_path) end - scenario "Create proposal too fast" do + scenario "Create proposal too fast", :js do allow(InvisibleCaptcha).to receive(:timestamp_threshold).and_return(Float::INFINITY) author = create(:user) @@ -420,7 +420,7 @@ visit new_proposal_path fill_in "Proposal title", with: "I am a bot" fill_in "Proposal summary", with: "This is the summary" - fill_in "Proposal text", with: "This is the description" + fill_in_ckeditor "Proposal text", with: "This is the description" fill_in "proposal_responsible_name", with: "Some other robot" check "proposal_terms_of_service" @@ -431,14 +431,14 @@ expect(page).to have_current_path(new_proposal_path) end - scenario "Responsible name is stored for anonymous users" do + scenario "Responsible name is stored for anonymous users", :js do author = create(:user) login_as(author) visit new_proposal_path fill_in "Proposal title", with: "Help refugees" fill_in "Proposal summary", with: "In summary, what we want is..." - fill_in "Proposal text", with: "This is very important because..." + fill_in_ckeditor "Proposal text", with: "This is very important because..." fill_in "proposal_responsible_name", with: "Isabel Garcia" fill_in "proposal_responsible_name", with: "Isabel Garcia" check "proposal_terms_of_service" @@ -452,7 +452,7 @@ expect(Proposal.last.responsible_name).to eq("Isabel Garcia") end - scenario "Responsible name field is not shown for verified users" do + scenario "Responsible name field is not shown for verified users", :js do author = create(:user, :level_two) login_as(author) @@ -461,7 +461,7 @@ fill_in "Proposal title", with: "Help refugees" fill_in "Proposal summary", with: "In summary, what we want is..." - fill_in "Proposal text", with: "This is very important because..." + fill_in_ckeditor "Proposal text", with: "This is very important because..." check "proposal_terms_of_service" click_button "Create proposal" @@ -505,14 +505,14 @@ expect(page.html).not_to include "<p>This is" end - scenario "Autolinking is applied to description" do + scenario "Autolinking is applied to description", :js do author = create(:user) login_as(author) visit new_proposal_path fill_in "Proposal title", with: "Testing auto link" fill_in "Proposal summary", with: "In summary, what we want is..." - fill_in "Proposal text", with: "

This is a link www.example.org

" + fill_in_ckeditor "Proposal text", with: "This is a link www.example.org" fill_in "proposal_responsible_name", with: "Isabel Garcia" check "proposal_terms_of_service" @@ -563,7 +563,7 @@ end context "Geozones" do - scenario "Default whole city" do + scenario "Default whole city", :js do author = create(:user) login_as(author) @@ -581,7 +581,7 @@ end end - scenario "Specific geozone" do + scenario "Specific geozone", :js do create(:geozone, name: "California") create(:geozone, name: "New York") login_as(create(:user)) @@ -590,7 +590,7 @@ fill_in "Proposal title", with: "Help refugees" fill_in "Proposal summary", with: "In summary, what we want is..." - fill_in "Proposal text", with: "This is very important because..." + fill_in_ckeditor "Proposal text", with: "This is very important because..." fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yPQfcG-eimk" fill_in "proposal_responsible_name", with: "Isabel Garcia" check "proposal_terms_of_service" @@ -749,7 +749,7 @@ Setting["max_votes_for_proposal_edit"] = 1000 end - scenario "Update should be posible for the author of an editable proposal" do + scenario "Update should be posible for the author of an editable proposal", :js do proposal = create(:proposal) login_as(proposal.author) @@ -758,7 +758,7 @@ fill_in "Proposal title", with: "End child poverty" fill_in "Proposal summary", with: "Basically..." - fill_in "Proposal text", with: "Let's do something to end child poverty" + fill_in_ckeditor "Proposal text", with: "Let's do something to end child poverty" fill_in "proposal_responsible_name", with: "Isabel Garcia" click_button "Save changes" @@ -1584,7 +1584,7 @@ Setting["feature.user.skip_verification"] = "true" end - scenario "Create" do + scenario "Create", :js do author = create(:user) login_as(author) @@ -1598,7 +1598,7 @@ fill_in "Proposal title", with: "Help refugees" fill_in "Proposal summary", with: "In summary what we want is..." - fill_in "Proposal text", with: "This is very important because..." + fill_in_ckeditor "Proposal text", with: "This is very important because..." fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yPQfcG-eimk" fill_in "proposal_tag_list", with: "Refugees, Solidarity" check "proposal_terms_of_service" diff --git a/spec/system/tags/budget_investments_spec.rb b/spec/system/tags/budget_investments_spec.rb index 032c60ab55c..fd61568ec00 100644 --- a/spec/system/tags/budget_investments_spec.rb +++ b/spec/system/tags/budget_investments_spec.rb @@ -61,14 +61,14 @@ expect(page).to have_content(tag_economia.name) end - scenario "Create with custom tags" do + scenario "Create with custom tags", :js do login_as(author) visit new_budget_investment_path(budget_id: budget.id) select heading.name, from: "budget_investment_heading_id" fill_in "Title", with: "Build a skyscraper" - fill_in "Description", with: "I want to live in a high tower over the clouds" + fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds" check "budget_investment_terms_of_service" fill_in "budget_investment_tag_list", with: "#{tag_medio_ambiente.name}, #{tag_economia.name}" @@ -149,14 +149,14 @@ end end - scenario "Create with too many tags" do + scenario "Create with too many tags", :js do login_as(author) visit new_budget_investment_path(budget_id: budget.id) select heading.name, from: "budget_investment_heading_id" fill_in "Title", with: "Build a skyscraper" - fill_in "Description", with: "I want to live in a high tower over the clouds" + fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds" check "budget_investment_terms_of_service" fill_in "budget_investment_tag_list", with: "Impuestos, Economía, Hacienda, Sanidad, Educación, Política, Igualdad" @@ -167,14 +167,14 @@ expect(page).to have_content "tags must be less than or equal to 6" end - scenario "Create with dangerous strings" do + scenario "Create with dangerous strings", :js do login_as(author) visit new_budget_investment_path(budget_id: budget.id) select heading.name, from: "budget_investment_heading_id" fill_in "Title", with: "Build a skyscraper" - fill_in "Description", with: "I want to live in a high tower over the clouds" + fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds" check "budget_investment_terms_of_service" fill_in "budget_investment_tag_list", with: "user_id=1, &a=3, " diff --git a/spec/system/tags/debates_spec.rb b/spec/system/tags/debates_spec.rb index 1c30f80bf81..ca6330516af 100644 --- a/spec/system/tags/debates_spec.rb +++ b/spec/system/tags/debates_spec.rb @@ -60,13 +60,13 @@ expect(page).to have_content "Hacienda" end - scenario "Create" do + scenario "Create", :js do user = create(:user) login_as(user) visit new_debate_path fill_in "Debate title", with: "Title" - fill_in "Initial debate text", with: "Description" + fill_in_ckeditor "Initial debate text", with: "Description" check "debate_terms_of_service" fill_in "debate_tag_list", with: "Impuestos, Economía, Hacienda" @@ -79,13 +79,13 @@ expect(page).to have_content "Impuestos" end - scenario "Create with too many tags" do + scenario "Create with too many tags", :js do user = create(:user) login_as(user) visit new_debate_path fill_in "Debate title", with: "Title" - fill_in "Initial debate text", with: "Description" + fill_in_ckeditor "Initial debate text", with: "Description" check "debate_terms_of_service" fill_in "debate_tag_list", with: "Impuestos, Economía, Hacienda, Sanidad, Educación, Política, Igualdad" @@ -96,14 +96,14 @@ expect(page).to have_content "tags must be less than or equal to 6" end - scenario "Create with dangerous strings" do + scenario "Create with dangerous strings", :js do user = create(:user) login_as(user) visit new_debate_path fill_in "Debate title", with: "A test of dangerous strings" - fill_in "Initial debate text", with: "A description suitable for this test" + fill_in_ckeditor "Initial debate text", with: "A description suitable for this test" check "debate_terms_of_service" fill_in "debate_tag_list", with: "user_id=1, &a=3, " diff --git a/spec/system/tags/proposals_spec.rb b/spec/system/tags/proposals_spec.rb index ff101b0e255..e3afc50ca50 100644 --- a/spec/system/tags/proposals_spec.rb +++ b/spec/system/tags/proposals_spec.rb @@ -59,14 +59,14 @@ expect(page).to have_content "Hacienda" end - scenario "Create with custom tags" do + scenario "Create with custom tags", :js do user = create(:user) login_as(user) visit new_proposal_path fill_in "Proposal title", with: "Help refugees" fill_in "Proposal summary", with: "In summary, what we want is..." - fill_in "Proposal text", with: "This is very important because..." + fill_in_ckeditor "Proposal text", with: "This is very important because..." fill_in "proposal_responsible_name", with: "Isabel Garcia" fill_in "proposal_tag_list", with: "Economía, Hacienda" check "proposal_terms_of_service" @@ -108,13 +108,13 @@ end end - scenario "Create with too many tags" do + scenario "Create with too many tags", :js do user = create(:user) login_as(user) visit new_proposal_path fill_in "Proposal title", with: "Title" - fill_in "Proposal text", with: "Description" + fill_in_ckeditor "Proposal text", with: "Description" check "proposal_terms_of_service" fill_in "proposal_tag_list", with: "Impuestos, Economía, Hacienda, Sanidad, Educación, Política, Igualdad" @@ -125,7 +125,7 @@ expect(page).to have_content "tags must be less than or equal to 6" end - scenario "Create with dangerous strings" do + scenario "Create with dangerous strings", :js do author = create(:user) login_as(author) @@ -133,7 +133,7 @@ fill_in "Proposal title", with: "A test of dangerous strings" fill_in "Proposal summary", with: "In summary, what we want is..." - fill_in "Proposal text", with: "A description suitable for this test" + fill_in_ckeditor "Proposal text", with: "A description suitable for this test" fill_in "proposal_responsible_name", with: "Isabel Garcia" check "proposal_terms_of_service" diff --git a/spec/system/tags_spec.rb b/spec/system/tags_spec.rb index 56e6f47a980..ee21fdcf126 100644 --- a/spec/system/tags_spec.rb +++ b/spec/system/tags_spec.rb @@ -53,13 +53,13 @@ expect(page).to have_content "Hacienda" end - scenario "Create" do + scenario "Create", :js do user = create(:user) login_as(user) visit new_debate_path fill_in "Debate title", with: "Title" - fill_in "Initial debate text", with: "Description" + fill_in_ckeditor "Initial debate text", with: "Description" check "debate_terms_of_service" fill_in "debate_tag_list", with: "Impuestos, Economía, Hacienda" @@ -72,13 +72,13 @@ expect(page).to have_content "Impuestos" end - scenario "Create with too many tags" do + scenario "Create with too many tags", :js do user = create(:user) login_as(user) visit new_debate_path fill_in "Debate title", with: "Title" - fill_in "Initial debate text", with: "Description" + fill_in_ckeditor "Initial debate text", with: "Description" check "debate_terms_of_service" fill_in "debate_tag_list", with: "Impuestos, Economía, Hacienda, Sanidad, Educación, Política, Igualdad"