diff --git a/spec/features/account_spec.rb b/spec/features/account_spec.rb index 3d3b85c27..cd52f5e5c 100644 --- a/spec/features/account_spec.rb +++ b/spec/features/account_spec.rb @@ -67,7 +67,7 @@ describe "Account" do " complete the confirmation of your new email address." expect(page).to have_content notice - email = open_last_email + open_last_email visit_in_email("Confirm my account") logout diff --git a/spec/features/admin/legislation/draft_versions_spec.rb b/spec/features/admin/legislation/draft_versions_spec.rb index 4a072de4d..06808979f 100644 --- a/spec/features/admin/legislation/draft_versions_spec.rb +++ b/spec/features/admin/legislation/draft_versions_spec.rb @@ -36,7 +36,7 @@ describe "Admin legislation draft versions" do context "Create" do scenario "Valid legislation draft version" do - process = create(:legislation_process, title: "An example legislation process") + create(:legislation_process, title: "An example legislation process") visit admin_root_path diff --git a/spec/features/admin/legislation/questions_spec.rb b/spec/features/admin/legislation/questions_spec.rb index fc811c624..6b6a41fdf 100644 --- a/spec/features/admin/legislation/questions_spec.rb +++ b/spec/features/admin/legislation/questions_spec.rb @@ -24,8 +24,8 @@ describe "Admin legislation questions" do context "Index" do scenario "Displaying legislation process questions" do - question = create(:legislation_question, process: process, title: "Question 1") - question = create(:legislation_question, process: process, title: "Question 2") + create(:legislation_question, process: process, title: "Question 1") + create(:legislation_question, process: process, title: "Question 2") visit admin_legislation_processes_path(filter: "all") @@ -63,7 +63,7 @@ describe "Admin legislation questions" do context "Update" do scenario "Valid legislation question", :js do - question = create(:legislation_question, title: "Question 2", process: process) + create(:legislation_question, title: "Question 2", process: process) visit admin_root_path diff --git a/spec/features/admin/poll/booth_assigments_spec.rb b/spec/features/admin/poll/booth_assigments_spec.rb index 117b991a0..0441363fb 100644 --- a/spec/features/admin/poll/booth_assigments_spec.rb +++ b/spec/features/admin/poll/booth_assigments_spec.rb @@ -79,7 +79,7 @@ describe "Admin booths assignments" do end scenario "Unassign booth from poll", :js do - assignment = create(:poll_booth_assignment, poll: poll, booth: booth) + create(:poll_booth_assignment, poll: poll, booth: booth) visit admin_poll_path(poll) within("#poll-resources") do diff --git a/spec/features/admin/site_customization/content_blocks_spec.rb b/spec/features/admin/site_customization/content_blocks_spec.rb index e21a76e88..52179593a 100644 --- a/spec/features/admin/site_customization/content_blocks_spec.rb +++ b/spec/features/admin/site_customization/content_blocks_spec.rb @@ -42,7 +42,7 @@ describe "Admin custom content blocks" do end scenario "Invalid custom block" do - block = create(:site_customization_content_block) + create(:site_customization_content_block) visit admin_root_path @@ -68,7 +68,8 @@ describe "Admin custom content blocks" do context "Update" do scenario "Valid custom block" do - block = create(:site_customization_content_block) + create(:site_customization_content_block) + visit admin_root_path within("#side_menu") do diff --git a/spec/features/admin/stats_spec.rb b/spec/features/admin/stats_spec.rb index ddca0157a..4f5dcf0b5 100644 --- a/spec/features/admin/stats_spec.rb +++ b/spec/features/admin/stats_spec.rb @@ -357,7 +357,7 @@ describe "Stats" do context "Polls" do scenario "Total participants by origin" do - oa = create(:poll_officer_assignment) + create(:poll_officer_assignment) 3.times { create(:poll_voter, origin: "web") } visit admin_stats_path diff --git a/spec/features/admin/tags_spec.rb b/spec/features/admin/tags_spec.rb index ac8a3856a..1363d6842 100644 --- a/spec/features/admin/tags_spec.rb +++ b/spec/features/admin/tags_spec.rb @@ -69,7 +69,8 @@ describe "Admin tags" do context "Manage only tags of kind category" do scenario "Index shows only categories" do - not_category_tag = create(:tag, name: "Not a category") + create(:tag, name: "Not a category") + visit admin_tags_path expect(page).to have_content @tag1.name diff --git a/spec/features/admin/valuator_groups_spec.rb b/spec/features/admin/valuator_groups_spec.rb index a78a2bbcd..57b40b4f5 100644 --- a/spec/features/admin/valuator_groups_spec.rb +++ b/spec/features/admin/valuator_groups_spec.rb @@ -57,7 +57,7 @@ describe "Valuator groups" do end scenario "Update" do - group = create(:valuator_group, name: "Health") + create(:valuator_group, name: "Health") visit admin_valuator_groups_path click_link "Edit" @@ -70,7 +70,7 @@ describe "Valuator groups" do end scenario "Delete" do - group = create(:valuator_group) + create(:valuator_group) visit admin_valuator_groups_path click_link "Delete" diff --git a/spec/features/admin/verifications_spec.rb b/spec/features/admin/verifications_spec.rb index 8bbc1174a..49a7c015c 100644 --- a/spec/features/admin/verifications_spec.rb +++ b/spec/features/admin/verifications_spec.rb @@ -22,9 +22,9 @@ describe "Incomplete verifications" do end scenario "Search" do - verified_user = create(:user, :level_two, username: "Juan Carlos") - unverified_user = create(:user, :incomplete_verification, username: "Juan_anonymous") - unverified_user = create(:user, :incomplete_verification, username: "Isabel_anonymous") + create(:user, :level_two, username: "Juan Carlos") + create(:user, :incomplete_verification, username: "Juan_anonymous") + create(:user, :incomplete_verification, username: "Isabel_anonymous") visit admin_verifications_path diff --git a/spec/features/budget_polls/officing_spec.rb b/spec/features/budget_polls/officing_spec.rb index 28094bc84..02f1a187e 100644 --- a/spec/features/budget_polls/officing_spec.rb +++ b/spec/features/budget_polls/officing_spec.rb @@ -17,10 +17,7 @@ describe "Budget Poll Officing" do expect(page).not_to have_content("Total recounts and results") create(:poll_shift, officer: officer, booth: booth, date: Date.current, task: :recount_scrutiny) - - officer_assignment = create(:poll_officer_assignment, - booth_assignment: booth_assignment, - officer: officer) + create(:poll_officer_assignment, booth_assignment: booth_assignment, officer: officer) visit officing_root_path diff --git a/spec/features/budget_polls/questions_spec.rb b/spec/features/budget_polls/questions_spec.rb index 6de56c3e3..55cf41a43 100644 --- a/spec/features/budget_polls/questions_spec.rb +++ b/spec/features/budget_polls/questions_spec.rb @@ -8,8 +8,8 @@ describe "Poll Questions" do end scenario "Do not display polls associated to a budget" do - poll1 = create(:poll, name: "Citizen Proposal Poll") - poll2 = create(:poll, :for_budget, name: "Participatory Budget Poll") + create(:poll, name: "Citizen Proposal Poll") + create(:poll, :for_budget, name: "Participatory Budget Poll") visit admin_questions_path diff --git a/spec/features/budgets/ballots_spec.rb b/spec/features/budgets/ballots_spec.rb index 544948837..478055de4 100644 --- a/spec/features/budgets/ballots_spec.rb +++ b/spec/features/budgets/ballots_spec.rb @@ -77,10 +77,10 @@ describe "Ballots" do end scenario "Headings" do - city_heading1 = create(:budget_heading, group: city, name: "Investments Type1") - city_heading2 = create(:budget_heading, group: city, name: "Investments Type2") - district_heading1 = create(:budget_heading, group: districts, name: "District 1") - district_heading2 = create(:budget_heading, group: districts, name: "District 2") + create(:budget_heading, group: city, name: "Investments Type1") + create(:budget_heading, group: city, name: "Investments Type2") + create(:budget_heading, group: districts, name: "District 1") + create(:budget_heading, group: districts, name: "District 2") visit budget_path(budget) click_link "City" diff --git a/spec/features/budgets/budgets_spec.rb b/spec/features/budgets/budgets_spec.rb index 2bd64d17c..aeecff8b7 100644 --- a/spec/features/budgets/budgets_spec.rb +++ b/spec/features/budgets/budgets_spec.rb @@ -367,8 +367,8 @@ describe "Budgets" do context "Show" do scenario "List all groups" do - group1 = create(:budget_group, budget: budget) - group2 = create(:budget_group, budget: budget) + create(:budget_group, budget: budget) + create(:budget_group, budget: budget) visit budget_path(budget) diff --git a/spec/features/comments/budget_investments_spec.rb b/spec/features/comments/budget_investments_spec.rb index 6465e4489..aabeba2ed 100644 --- a/spec/features/comments/budget_investments_spec.rb +++ b/spec/features/comments/budget_investments_spec.rb @@ -7,7 +7,7 @@ describe "Commenting Budget::Investments" do scenario "Index" do 3.times { create(:comment, commentable: investment) } - valuation_comment = create(:comment, :valuation, commentable: investment, subject: "Not viable") + create(:comment, :valuation, commentable: investment, subject: "Not viable") visit budget_investment_path(investment.budget, investment) diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index d0588b1f8..921ac93ca 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -922,9 +922,9 @@ describe "Debates" do end scenario "Order by relevance by default", :js do - debate1 = create(:debate, title: "Show you got", cached_votes_up: 10) - debate2 = create(:debate, title: "Show what you got", cached_votes_up: 1) - debate3 = create(:debate, title: "Show you got", cached_votes_up: 100) + create(:debate, title: "Show you got", cached_votes_up: 10) + create(:debate, title: "Show what you got", cached_votes_up: 1) + create(:debate, title: "Show you got", cached_votes_up: 100) visit debates_path fill_in "search", with: "Show you got" @@ -940,10 +940,10 @@ describe "Debates" do end scenario "Reorder results maintaing search", :js do - debate1 = create(:debate, title: "Show you got", cached_votes_up: 10, created_at: 1.week.ago) - debate2 = create(:debate, title: "Show what you got", cached_votes_up: 1, created_at: 1.month.ago) - debate3 = create(:debate, title: "Show you got", cached_votes_up: 100, created_at: Time.current) - debate4 = create(:debate, title: "Do not display", cached_votes_up: 1, created_at: 1.week.ago) + create(:debate, title: "Show you got", cached_votes_up: 10, created_at: 1.week.ago) + create(:debate, title: "Show what you got", cached_votes_up: 1, created_at: 1.month.ago) + create(:debate, title: "Show you got", cached_votes_up: 100, created_at: Time.current) + create(:debate, title: "Do not display", cached_votes_up: 1, created_at: 1.week.ago) visit debates_path fill_in "search", with: "Show you got" @@ -1088,13 +1088,13 @@ describe "Debates" do context "Suggesting debates" do scenario "Shows up to 5 suggestions", :js do - debate1 = create(:debate, title: "First debate has 1 vote", cached_votes_up: 1) - debate2 = create(:debate, title: "Second debate has 2 votes", cached_votes_up: 2) - debate3 = create(:debate, title: "Third debate has 3 votes", cached_votes_up: 3) - debate4 = create(:debate, title: "This one has 4 votes", description: "This is the fourth debate", cached_votes_up: 4) - debate5 = create(:debate, title: "Fifth debate has 5 votes", cached_votes_up: 5) - debate6 = create(:debate, title: "Sixth debate has 6 votes", description: "This is the sixth debate", cached_votes_up: 6) - debate7 = create(:debate, title: "This has seven votes, and is not suggest", description: "This is the seven", cached_votes_up: 7) + create(:debate, title: "First debate has 1 vote", cached_votes_up: 1) + create(:debate, title: "Second debate has 2 votes", cached_votes_up: 2) + create(:debate, title: "Third debate has 3 votes", cached_votes_up: 3) + create(:debate, title: "This one has 4 votes", description: "This is the fourth debate", cached_votes_up: 4) + create(:debate, title: "Fifth debate has 5 votes", cached_votes_up: 5) + create(:debate, title: "Sixth debate has 6 votes", description: "This is the sixth debate", cached_votes_up: 6) + create(:debate, title: "This has seven votes, and is not suggest", description: "This is the seven", cached_votes_up: 7) login_as(create(:user)) visit new_debate_path @@ -1107,8 +1107,8 @@ describe "Debates" do end scenario "No found suggestions", :js do - debate1 = create(:debate, title: "First debate has 10 vote", cached_votes_up: 10) - debate2 = create(:debate, title: "Second debate has 2 votes", cached_votes_up: 2) + create(:debate, title: "First debate has 10 vote", cached_votes_up: 10) + create(:debate, title: "Second debate has 2 votes", cached_votes_up: 2) login_as(create(:user)) visit new_debate_path @@ -1153,8 +1153,8 @@ describe "Debates" do end scenario "Index include featured debates" do - debate1 = create(:debate, featured_at: Time.current) - debate2 = create(:debate) + create(:debate, featured_at: Time.current) + create(:debate) login_as(create(:administrator).user) visit debates_path @@ -1164,8 +1164,8 @@ describe "Debates" do end scenario "Index do not show featured debates if none is marked as featured" do - debate1 = create(:debate) - debate2 = create(:debate) + create(:debate) + create(:debate) login_as(create(:administrator).user) visit debates_path diff --git a/spec/features/home_spec.rb b/spec/features/home_spec.rb index 38a42be1f..c663ef73e 100644 --- a/spec/features/home_spec.rb +++ b/spec/features/home_spec.rb @@ -11,7 +11,7 @@ describe "Home" do end scenario "Not display recommended section" do - debate = create(:debate) + create(:debate) visit root_path @@ -32,13 +32,15 @@ describe "Home" do end scenario "Display recommended section when feature flag recommended is active" do - debate = create(:debate, tag_list: "Sport") + create(:debate, tag_list: "Sport") + visit root_path + expect(page).to have_content "Recommendations that may interest you" end scenario "Not display recommended section when feature flag recommended is not active" do - debate = create(:debate, tag_list: "Sport") + create(:debate, tag_list: "Sport") Setting["feature.user.recommendations"] = false visit root_path @@ -56,8 +58,10 @@ describe "Home" do end scenario "Display all recommended debates link" do - debate = create(:debate, tag_list: "Sport") + create(:debate, tag_list: "Sport") + visit root_path + expect(page).to have_link("All recommended debates", href: debates_path(order: "recommendations")) end @@ -71,8 +75,10 @@ describe "Home" do end scenario "Display all recommended proposals link" do - debate = create(:proposal, tag_list: "Sport") + create(:proposal, tag_list: "Sport") + visit root_path + expect(page).to have_link("All recommended proposals", href: proposals_path(order: "recommendations")) end @@ -140,7 +146,7 @@ describe "Home" do end scenario "if there are cards, the 'featured' title will render" do - card = create(:widget_card, + create(:widget_card, title: "Card text", description: "Card description", link_text: "Link text", diff --git a/spec/features/notifications_spec.rb b/spec/features/notifications_spec.rb index 08b39f619..c2e0ac708 100644 --- a/spec/features/notifications_spec.rb +++ b/spec/features/notifications_spec.rb @@ -69,8 +69,7 @@ describe "Notifications" do end scenario "Mark all as read" do - notification1 = create(:notification, user: user) - notification2 = create(:notification, user: user) + 2.times { create(:notification, user: user) } click_notifications_icon diff --git a/spec/features/officing/results_spec.rb b/spec/features/officing/results_spec.rb index 222562e2f..e73f5e41f 100644 --- a/spec/features/officing/results_spec.rb +++ b/spec/features/officing/results_spec.rb @@ -123,19 +123,20 @@ describe "Officing Results", :with_frozen_time do end scenario "Index lists all questions and answers" do - partial_result = create(:poll_partial_result, - officer_assignment: poll_officer.officer_assignments.first, - booth_assignment: poll_officer.officer_assignments.first.booth_assignment, - date: poll.ends_at, - question: @question_1, - amount: 33) - poll_recount = create(:poll_recount, - officer_assignment: poll_officer.officer_assignments.first, - booth_assignment: poll_officer.officer_assignments.first.booth_assignment, - date: poll.ends_at, - white_amount: 21, - null_amount: 44, - total_amount: 66) + create(:poll_partial_result, + officer_assignment: poll_officer.officer_assignments.first, + booth_assignment: poll_officer.officer_assignments.first.booth_assignment, + date: poll.ends_at, + question: @question_1, + amount: 33) + + create(:poll_recount, + officer_assignment: poll_officer.officer_assignments.first, + booth_assignment: poll_officer.officer_assignments.first.booth_assignment, + date: poll.ends_at, + white_amount: 21, + null_amount: 44, + total_amount: 66) visit officing_poll_results_path(poll, date: I18n.l(poll.ends_at.to_date), diff --git a/spec/features/officing_spec.rb b/spec/features/officing_spec.rb index ba1676f78..bb5a7afd1 100644 --- a/spec/features/officing_spec.rb +++ b/spec/features/officing_spec.rb @@ -135,8 +135,8 @@ describe "Poll Officing" do create(:poll_shift, officer: officer1, booth: booth, date: Date.current, task: :vote_collection) create(:poll_shift, officer: officer2, booth: booth, date: Date.current, task: :vote_collection) - officer_assignment_1 = create(:poll_officer_assignment, booth_assignment: booth_assignment, officer: officer1) - officer_assignment_2 = create(:poll_officer_assignment, booth_assignment: booth_assignment, officer: officer2) + create(:poll_officer_assignment, booth_assignment: booth_assignment, officer: officer1) + create(:poll_officer_assignment, booth_assignment: booth_assignment, officer: officer2) in_browser(:one) do login_as officer1.user diff --git a/spec/features/polls/polls_spec.rb b/spec/features/polls/polls_spec.rb index f3f96b8b6..ead8aafaa 100644 --- a/spec/features/polls/polls_spec.rb +++ b/spec/features/polls/polls_spec.rb @@ -70,7 +70,7 @@ describe "Polls" do end scenario "Displays icon correctly", :js do - polls = create_list(:poll, 3) + create_list(:poll, 3) visit polls_path diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index a079b5d4c..2fd156fbc 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -483,10 +483,9 @@ describe "Proposals" do end scenario "Specific geozone" do - geozone = create(:geozone, name: "California") - geozone = create(:geozone, name: "New York") - author = create(:user) - login_as(author) + create(:geozone, name: "California") + create(:geozone, name: "New York") + login_as(create(:user)) visit new_proposal_path @@ -1438,9 +1437,9 @@ describe "Proposals" do end scenario "Order by relevance by default", :js do - proposal1 = create(:proposal, title: "Show you got", cached_votes_up: 10) - proposal2 = create(:proposal, title: "Show what you got", cached_votes_up: 1) - proposal3 = create(:proposal, title: "Show you got", cached_votes_up: 100) + create(:proposal, title: "Show you got", cached_votes_up: 10) + create(:proposal, title: "Show what you got", cached_votes_up: 1) + create(:proposal, title: "Show you got", cached_votes_up: 100) visit proposals_path fill_in "search", with: "Show what you got" @@ -1456,10 +1455,10 @@ describe "Proposals" do end scenario "Reorder results maintaing search", :js do - proposal1 = create(:proposal, title: "Show you got", cached_votes_up: 10, created_at: 1.week.ago) - proposal2 = create(:proposal, title: "Show what you got", cached_votes_up: 1, created_at: 1.month.ago) - proposal3 = create(:proposal, title: "Show you got", cached_votes_up: 100, created_at: Time.current) - proposal4 = create(:proposal, title: "Do not display", cached_votes_up: 1, created_at: 1.week.ago) + create(:proposal, title: "Show you got", cached_votes_up: 10, created_at: 1.week.ago) + create(:proposal, title: "Show what you got", cached_votes_up: 1, created_at: 1.month.ago) + create(:proposal, title: "Show you got", cached_votes_up: 100, created_at: Time.current) + create(:proposal, title: "Do not display", cached_votes_up: 1, created_at: 1.week.ago) visit proposals_path fill_in "search", with: "Show what you got" diff --git a/spec/features/site_customization/custom_pages_spec.rb b/spec/features/site_customization/custom_pages_spec.rb index 2f1a70755..980996922 100644 --- a/spec/features/site_customization/custom_pages_spec.rb +++ b/spec/features/site_customization/custom_pages_spec.rb @@ -73,7 +73,7 @@ describe "Custom Pages" do end scenario "Listed in more information page" do - custom_page = create(:site_customization_page, :published, + create(:site_customization_page, :published, slug: "another-slug", title_en: "Another custom page", subtitle_en: "Subtitle for custom page", diff --git a/spec/features/tags/budget_investments_spec.rb b/spec/features/tags/budget_investments_spec.rb index 0470d7198..633411a07 100644 --- a/spec/features/tags/budget_investments_spec.rb +++ b/spec/features/tags/budget_investments_spec.rb @@ -101,8 +101,8 @@ describe "Tags" do end scenario "Turbolinks sanity check from budget's show", :js do - education = create(:tag, name: "Education", kind: "category") - health = create(:tag, name: "Health", kind: "category") + create(:tag, name: "Education", kind: "category") + create(:tag, name: "Health", kind: "category") login_as(author) visit budget_path(budget) @@ -125,8 +125,8 @@ describe "Tags" do end scenario "Turbolinks sanity check from budget heading's show", :js do - education = create(:tag, name: "Education", kind: "category") - health = create(:tag, name: "Health", kind: "category") + create(:tag, name: "Education", kind: "category") + create(:tag, name: "Health", kind: "category") login_as(author) visit budget_investments_path(budget, heading_id: heading.id) diff --git a/spec/features/tags/debates_spec.rb b/spec/features/tags/debates_spec.rb index 2fcd2bb6e..8557702ae 100644 --- a/spec/features/tags/debates_spec.rb +++ b/spec/features/tags/debates_spec.rb @@ -43,8 +43,8 @@ describe "Tags" do end scenario "Index tag does not show featured debates" do - featured_debates = create_featured_debates - debates = create(:debate, tag_list: "123") + create_featured_debates + create(:debate, tag_list: "123") visit debates_path(tag: "123") @@ -186,8 +186,8 @@ describe "Tags" do context "Tag cloud" do scenario "Display user tags" do - earth = create(:debate, tag_list: "Medio Ambiente") - money = create(:debate, tag_list: "Economía") + create(:debate, tag_list: "Medio Ambiente") + create(:debate, tag_list: "Economía") visit debates_path diff --git a/spec/features/tags/proposals_spec.rb b/spec/features/tags/proposals_spec.rb index 68a89511d..0dbb553c1 100644 --- a/spec/features/tags/proposals_spec.rb +++ b/spec/features/tags/proposals_spec.rb @@ -29,7 +29,7 @@ describe "Tags" do end scenario "Index featured proposals does not show tags" do - proposal = create(:proposal, tag_list: "123") + create(:proposal, tag_list: "123") visit proposals_path(tag: "123") @@ -83,8 +83,8 @@ describe "Tags" do end scenario "Category with category tags", :js do - education = create(:tag, :category, name: "Education") - health = create(:tag, :category, name: "Health") + create(:tag, :category, name: "Education") + create(:tag, :category, name: "Health") login_as(create(:user)) visit new_proposal_path @@ -220,8 +220,8 @@ describe "Tags" do context "Tag cloud" do scenario "Display user tags" do - earth = create(:proposal, tag_list: "Medio Ambiente") - money = create(:proposal, tag_list: "Economía") + create(:proposal, tag_list: "Medio Ambiente") + create(:proposal, tag_list: "Economía") visit proposals_path @@ -256,8 +256,8 @@ describe "Tags" do create(:tag, :category, name: "Medio Ambiente") create(:tag, :category, name: "Economía") - earth = create(:proposal, tag_list: "Medio Ambiente") - money = create(:proposal, tag_list: "Economía") + create(:proposal, tag_list: "Medio Ambiente") + create(:proposal, tag_list: "Economía") visit proposals_path diff --git a/spec/features/tags_spec.rb b/spec/features/tags_spec.rb index 0d1b28e43..9c566d9d0 100644 --- a/spec/features/tags_spec.rb +++ b/spec/features/tags_spec.rb @@ -124,8 +124,8 @@ describe "Tags" do context "Tag cloud" do scenario "Proposals" do - earth = create(:proposal, tag_list: "Medio Ambiente") - money = create(:proposal, tag_list: "Economía") + create(:proposal, tag_list: "Medio Ambiente") + create(:proposal, tag_list: "Economía") visit proposals_path @@ -136,8 +136,8 @@ describe "Tags" do end scenario "Debates" do - earth = create(:debate, tag_list: "Medio Ambiente") - money = create(:debate, tag_list: "Economía") + create(:debate, tag_list: "Medio Ambiente") + create(:debate, tag_list: "Economía") visit debates_path @@ -151,8 +151,8 @@ describe "Tags" do create(:tag, :category, name: "Medio Ambiente") create(:tag, :category, name: "Economía") - earth = create(:proposal, tag_list: "Medio Ambiente, Agua") - money = create(:proposal, tag_list: "Economía, Corrupción") + create(:proposal, tag_list: "Medio Ambiente, Agua") + create(:proposal, tag_list: "Economía, Corrupción") visit proposals_path(search: "Economía") @@ -167,8 +167,8 @@ describe "Tags" do create(:geozone, name: "Madrid") create(:geozone, name: "Barcelona") - earth = create(:proposal, tag_list: "Madrid, Agua") - money = create(:proposal, tag_list: "Barcelona, Playa") + create(:proposal, tag_list: "Madrid, Agua") + create(:proposal, tag_list: "Barcelona, Playa") visit proposals_path(search: "Barcelona") diff --git a/spec/models/direct_message_spec.rb b/spec/models/direct_message_spec.rb index 1af97c978..e37ec8cb2 100644 --- a/spec/models/direct_message_spec.rb +++ b/spec/models/direct_message_spec.rb @@ -85,8 +85,8 @@ describe DirectMessage do end it "does not return direct messages created another day" do - direct_message1 = create(:direct_message, created_at: 1.day.ago) - direct_message2 = create(:direct_message, created_at: 1.day.from_now) + create(:direct_message, created_at: 1.day.ago) + create(:direct_message, created_at: 1.day.from_now) expect(DirectMessage.today.count).to eq 0 end diff --git a/spec/models/legislation/process_spec.rb b/spec/models/legislation/process_spec.rb index d07dcb8ac..049ea8bf9 100644 --- a/spec/models/legislation/process_spec.rb +++ b/spec/models/legislation/process_spec.rb @@ -186,12 +186,12 @@ describe Legislation::Process do it "invalid format colors" do expect { - process = create(:legislation_process, background_color: "#123ghi", font_color: "#fff") + create(:legislation_process, background_color: "#123ghi", font_color: "#fff") }.to raise_error(ActiveRecord::RecordInvalid, "Validation failed: Background color is invalid") expect { - process = create(:legislation_process, background_color: "#fff", font_color: "ggg") + create(:legislation_process, background_color: "#fff", font_color: "ggg") }.to raise_error(ActiveRecord::RecordInvalid, "Validation failed: Font color is invalid") end diff --git a/spec/models/proposal_notification_spec.rb b/spec/models/proposal_notification_spec.rb index bc0334f0e..c7f99b90a 100644 --- a/spec/models/proposal_notification_spec.rb +++ b/spec/models/proposal_notification_spec.rb @@ -38,7 +38,7 @@ describe ProposalNotification do end it "blocks proposal notifications without proposal" do - proposal = build(:proposal_notification, proposal: nil).save!(validate: false) + build(:proposal_notification, proposal: nil).save!(validate: false) expect(ProposalNotification.public_for_api).not_to include(notification) end diff --git a/spec/shared/features/notifiable_in_app.rb b/spec/shared/features/notifiable_in_app.rb index 08ca37e71..a08bb771c 100644 --- a/spec/shared/features/notifiable_in_app.rb +++ b/spec/shared/features/notifiable_in_app.rb @@ -4,7 +4,7 @@ shared_examples "notifiable in-app" do |described_class| let!(:notifiable) { create(model_name(described_class), author: author) } scenario "Notification icon is shown" do - notification = create(:notification, notifiable: notifiable, user: author) + create(:notification, notifiable: notifiable, user: author) login_as author visit root_path diff --git a/spec/shared/features/relationable.rb b/spec/shared/features/relationable.rb index ea67fdcbb..70d5f999a 100644 --- a/spec/shared/features/relationable.rb +++ b/spec/shared/features/relationable.rb @@ -6,7 +6,7 @@ shared_examples "relationable" do |relationable_model_name| let(:user) { create(:user) } scenario "related contents are listed" do - related_content = create(:related_content, parent_relationable: relationable, child_relationable: related1, author: build(:user)) + create(:related_content, parent_relationable: relationable, child_relationable: related1, author: build(:user)) visit relationable.url within("#related-content-list") do