Change single quotes to double quotes
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
feature 'Admin booths assignments' do
|
||||
feature "Admin booths assignments" do
|
||||
|
||||
background do
|
||||
admin = create(:administrator)
|
||||
login_as(admin.user)
|
||||
end
|
||||
|
||||
feature 'Admin Booth Assignment management' do
|
||||
feature "Admin Booth Assignment management" do
|
||||
|
||||
let!(:poll) { create(:poll) }
|
||||
let!(:booth) { create(:poll_booth) }
|
||||
|
||||
scenario 'List Polls and Booths to manage', :js do
|
||||
scenario "List Polls and Booths to manage", :js do
|
||||
second_poll = create(:poll)
|
||||
second_booth = create(:poll_booth)
|
||||
|
||||
@@ -22,37 +22,37 @@ feature 'Admin booths assignments' do
|
||||
expect(page).to have_content(second_poll.name)
|
||||
|
||||
within("#poll_#{second_poll.id}") do
|
||||
click_link 'Manage assignments'
|
||||
click_link "Manage assignments"
|
||||
end
|
||||
|
||||
expect(page).to have_content "Assignments for poll '#{second_poll.name}'"
|
||||
expect(page).to have_content "Assignments for poll "#{second_poll.name}""
|
||||
|
||||
expect(page).to have_content(booth.name)
|
||||
expect(page).to have_content(second_booth.name)
|
||||
end
|
||||
|
||||
scenario 'Assign booth to poll', :js do
|
||||
scenario "Assign booth to poll", :js do
|
||||
visit admin_poll_path(poll)
|
||||
within('#poll-resources') do
|
||||
click_link 'Booths (0)'
|
||||
within("#poll-resources") do
|
||||
click_link "Booths (0)"
|
||||
end
|
||||
|
||||
expect(page).to have_content 'There are no booths assigned to this poll.'
|
||||
expect(page).to have_content "There are no booths assigned to this poll."
|
||||
expect(page).not_to have_content booth.name
|
||||
|
||||
fill_in 'search-booths', with: booth.name
|
||||
click_button 'Search'
|
||||
fill_in "search-booths", with: booth.name
|
||||
click_button "Search"
|
||||
expect(page).to have_content(booth.name)
|
||||
|
||||
visit manage_admin_poll_booth_assignments_path(poll)
|
||||
|
||||
expect(page).to have_content "Assignments for poll '#{poll.name}'"
|
||||
expect(page).to have_content "Assignments for poll "#{poll.name}""
|
||||
|
||||
within("#poll_booth_#{booth.id}") do
|
||||
expect(page).to have_content(booth.name)
|
||||
expect(page).to have_content "Unassigned"
|
||||
|
||||
click_link 'Assign booth'
|
||||
click_link "Assign booth"
|
||||
|
||||
expect(page).not_to have_content "Unassigned"
|
||||
expect(page).to have_content "Assigned"
|
||||
@@ -60,38 +60,38 @@ feature 'Admin booths assignments' do
|
||||
end
|
||||
|
||||
visit admin_poll_path(poll)
|
||||
within('#poll-resources') do
|
||||
click_link 'Booths (1)'
|
||||
within("#poll-resources") do
|
||||
click_link "Booths (1)"
|
||||
end
|
||||
|
||||
expect(page).not_to have_content 'There are no booths assigned to this poll.'
|
||||
expect(page).not_to have_content "There are no booths assigned to this poll."
|
||||
expect(page).to have_content booth.name
|
||||
end
|
||||
|
||||
scenario 'Unassign booth from poll', :js do
|
||||
scenario "Unassign booth from poll", :js do
|
||||
assignment = create(:poll_booth_assignment, poll: poll, booth: booth)
|
||||
|
||||
visit admin_poll_path(poll)
|
||||
within('#poll-resources') do
|
||||
click_link 'Booths (1)'
|
||||
within("#poll-resources") do
|
||||
click_link "Booths (1)"
|
||||
end
|
||||
|
||||
expect(page).not_to have_content 'There are no booths assigned to this poll.'
|
||||
expect(page).not_to have_content "There are no booths assigned to this poll."
|
||||
expect(page).to have_content booth.name
|
||||
|
||||
fill_in 'search-booths', with: booth.name
|
||||
click_button 'Search'
|
||||
fill_in "search-booths", with: booth.name
|
||||
click_button "Search"
|
||||
expect(page).to have_content(booth.name)
|
||||
|
||||
visit manage_admin_poll_booth_assignments_path(poll)
|
||||
|
||||
expect(page).to have_content "Assignments for poll '#{poll.name}'"
|
||||
expect(page).to have_content "Assignments for poll "#{poll.name}""
|
||||
|
||||
within("#poll_booth_#{booth.id}") do
|
||||
expect(page).to have_content(booth.name)
|
||||
expect(page).to have_content "Assigned"
|
||||
|
||||
click_link 'Unassign booth'
|
||||
click_link "Unassign booth"
|
||||
|
||||
expect(page).to have_content "Unassigned"
|
||||
expect(page).not_to have_content "Assigned"
|
||||
@@ -99,15 +99,15 @@ feature 'Admin booths assignments' do
|
||||
end
|
||||
|
||||
visit admin_poll_path(poll)
|
||||
within('#poll-resources') do
|
||||
click_link 'Booths (0)'
|
||||
within("#poll-resources") do
|
||||
click_link "Booths (0)"
|
||||
end
|
||||
|
||||
expect(page).to have_content 'There are no booths assigned to this poll.'
|
||||
expect(page).to have_content "There are no booths assigned to this poll."
|
||||
expect(page).not_to have_content booth.name
|
||||
end
|
||||
|
||||
scenario 'Unassing booth whith associated shifts', :js do
|
||||
scenario "Unassing booth whith associated shifts", :js do
|
||||
assignment = create(:poll_booth_assignment, poll: poll, booth: booth)
|
||||
officer = create(:poll_officer)
|
||||
create(:poll_officer_assignment, officer: officer, booth_assignment: assignment)
|
||||
@@ -119,7 +119,7 @@ feature 'Admin booths assignments' do
|
||||
expect(page).to have_content(booth.name)
|
||||
expect(page).to have_content "Assigned"
|
||||
|
||||
accept_confirm { click_link 'Unassign booth' }
|
||||
accept_confirm { click_link "Unassign booth" }
|
||||
|
||||
expect(page).to have_content "Unassigned"
|
||||
expect(page).not_to have_content "Assigned"
|
||||
@@ -137,14 +137,14 @@ feature 'Admin booths assignments' do
|
||||
expect(page).to have_content(booth.name)
|
||||
expect(page).to have_content "Assigned"
|
||||
|
||||
expect(page).not_to have_link 'Unassign booth'
|
||||
expect(page).not_to have_link "Unassign booth"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
feature 'Show' do
|
||||
scenario 'Lists all assigned poll officers' do
|
||||
feature "Show" do
|
||||
scenario "Lists all assigned poll officers" do
|
||||
poll = create(:poll)
|
||||
booth = create(:poll_booth)
|
||||
booth_assignment = create(:poll_booth_assignment, poll: poll, booth: booth)
|
||||
@@ -156,18 +156,18 @@ feature 'Admin booths assignments' do
|
||||
officer_2 = officer_assignment_2.officer
|
||||
|
||||
visit admin_poll_path(poll)
|
||||
click_link 'Booths (2)'
|
||||
click_link "Booths (2)"
|
||||
|
||||
within('#assigned_booths_list') { click_link booth.name }
|
||||
within("#assigned_booths_list") { click_link booth.name }
|
||||
|
||||
click_link 'Officers'
|
||||
within('#officers_list') do
|
||||
click_link "Officers"
|
||||
within("#officers_list") do
|
||||
expect(page).to have_content officer.name
|
||||
expect(page).not_to have_content officer_2.name
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Lists all recounts for the booth assignment' do
|
||||
scenario "Lists all recounts for the booth assignment" do
|
||||
poll = create(:poll, starts_at: 2.weeks.ago, ends_at: 1.week.ago)
|
||||
booth = create(:poll_booth)
|
||||
booth_assignment = create(:poll_booth_assignment, poll: poll, booth: booth)
|
||||
@@ -181,22 +181,22 @@ feature 'Admin booths assignments' do
|
||||
booth_assignment_2 = create(:poll_booth_assignment, poll: poll)
|
||||
|
||||
visit admin_poll_path(poll)
|
||||
click_link 'Booths (2)'
|
||||
click_link "Booths (2)"
|
||||
|
||||
within('#assigned_booths_list') { click_link booth.name }
|
||||
within("#assigned_booths_list") { click_link booth.name }
|
||||
|
||||
click_link 'Recounts'
|
||||
click_link "Recounts"
|
||||
|
||||
within('#totals') do
|
||||
within("#totals") do
|
||||
within("#total_system") { expect(page).to have_content "2" }
|
||||
end
|
||||
|
||||
within('#recounts_list') do
|
||||
within("#recounts_list") do
|
||||
within("#recounting_#{poll.starts_at.to_date.strftime('%Y%m%d')}") do
|
||||
expect(page).to have_content 1
|
||||
end
|
||||
within("#recounting_#{(poll.ends_at.to_date - 5.days).strftime('%Y%m%d')}") do
|
||||
expect(page).to have_content '-'
|
||||
expect(page).to have_content "-"
|
||||
end
|
||||
within("#recounting_#{poll.ends_at.to_date.strftime('%Y%m%d')}") do
|
||||
expect(page).to have_content 1
|
||||
@@ -204,47 +204,47 @@ feature 'Admin booths assignments' do
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Results for a booth assignment' do
|
||||
scenario "Results for a booth assignment" do
|
||||
poll = create(:poll)
|
||||
booth_assignment = create(:poll_booth_assignment, poll: poll)
|
||||
other_booth_assignment = create(:poll_booth_assignment, poll: poll)
|
||||
|
||||
question_1 = create(:poll_question, poll: poll)
|
||||
create(:poll_question_answer, title: 'Yes', question: question_1)
|
||||
create(:poll_question_answer, title: 'No', question: question_1)
|
||||
create(:poll_question_answer, title: "Yes", question: question_1)
|
||||
create(:poll_question_answer, title: "No", question: question_1)
|
||||
|
||||
question_2 = create(:poll_question, poll: poll)
|
||||
create(:poll_question_answer, title: 'Today', question: question_2)
|
||||
create(:poll_question_answer, title: 'Tomorrow', question: question_2)
|
||||
create(:poll_question_answer, title: "Today", question: question_2)
|
||||
create(:poll_question_answer, title: "Tomorrow", question: question_2)
|
||||
|
||||
create(:poll_partial_result,
|
||||
booth_assignment: booth_assignment,
|
||||
question: question_1,
|
||||
answer: 'Yes',
|
||||
answer: "Yes",
|
||||
amount: 11)
|
||||
|
||||
create(:poll_partial_result,
|
||||
booth_assignment: booth_assignment,
|
||||
question: question_1,
|
||||
answer: 'No',
|
||||
answer: "No",
|
||||
amount: 4)
|
||||
|
||||
create(:poll_partial_result,
|
||||
booth_assignment: booth_assignment,
|
||||
question: question_2,
|
||||
answer: 'Today',
|
||||
answer: "Today",
|
||||
amount: 5)
|
||||
|
||||
create(:poll_partial_result,
|
||||
booth_assignment: booth_assignment,
|
||||
question: question_2,
|
||||
answer: 'Tomorrow',
|
||||
answer: "Tomorrow",
|
||||
amount: 6)
|
||||
|
||||
create(:poll_partial_result,
|
||||
booth_assignment: other_booth_assignment,
|
||||
question: question_1,
|
||||
answer: 'Yes',
|
||||
answer: "Yes",
|
||||
amount: 9999)
|
||||
|
||||
create(:poll_recount,
|
||||
@@ -261,7 +261,7 @@ feature 'Admin booths assignments' do
|
||||
|
||||
visit admin_poll_booth_assignment_path(poll, booth_assignment)
|
||||
|
||||
click_link 'Results'
|
||||
click_link "Results"
|
||||
|
||||
expect(page).to have_content(question_1.title)
|
||||
|
||||
@@ -287,9 +287,9 @@ feature 'Admin booths assignments' do
|
||||
expect(page).to have_content(6)
|
||||
end
|
||||
|
||||
within('#white_results') { expect(page).to have_content('21') }
|
||||
within('#null_results') { expect(page).to have_content('44') }
|
||||
within('#total_results') { expect(page).to have_content('66') }
|
||||
within("#white_results") { expect(page).to have_content("21") }
|
||||
within("#null_results") { expect(page).to have_content("44") }
|
||||
within("#total_results") { expect(page).to have_content("66") }
|
||||
end
|
||||
|
||||
scenario "No results" do
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
feature 'Admin booths' do
|
||||
feature "Admin booths" do
|
||||
|
||||
background do
|
||||
admin = create(:administrator)
|
||||
login_as(admin.user)
|
||||
end
|
||||
|
||||
scenario 'Index empty' do
|
||||
scenario "Index empty" do
|
||||
visit admin_root_path
|
||||
|
||||
within('#side_menu') do
|
||||
within("#side_menu") do
|
||||
click_link "Booths location"
|
||||
end
|
||||
|
||||
expect(page).to have_content "There are no active booths for any upcoming poll."
|
||||
end
|
||||
|
||||
scenario 'Index' do
|
||||
scenario "Index" do
|
||||
3.times { create(:poll_booth) }
|
||||
|
||||
visit admin_root_path
|
||||
|
||||
within('#side_menu') do
|
||||
within("#side_menu") do
|
||||
click_link "Booths location"
|
||||
end
|
||||
|
||||
@@ -59,7 +59,7 @@ feature 'Admin booths' do
|
||||
expect(page).not_to have_link "Edit booth"
|
||||
end
|
||||
|
||||
scenario 'Show' do
|
||||
scenario "Show" do
|
||||
booth = create(:poll_booth)
|
||||
|
||||
visit admin_booths_path
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
feature 'Officer Assignments' do
|
||||
feature "Officer Assignments" do
|
||||
|
||||
background do
|
||||
admin = create(:administrator)
|
||||
@@ -23,9 +23,9 @@ feature 'Officer Assignments' do
|
||||
|
||||
visit admin_poll_path(poll)
|
||||
|
||||
click_link 'Officers (2)'
|
||||
click_link "Officers (2)"
|
||||
|
||||
within('#officer_assignments') do
|
||||
within("#officer_assignments") do
|
||||
expect(page).to have_content officer1.name
|
||||
expect(page).to have_content officer2.name
|
||||
expect(page).not_to have_content officer3.name
|
||||
@@ -52,12 +52,12 @@ feature 'Officer Assignments' do
|
||||
|
||||
visit admin_poll_path(poll)
|
||||
|
||||
click_link 'Officers (2)'
|
||||
click_link "Officers (2)"
|
||||
|
||||
fill_in "search-officers", with: "John"
|
||||
click_button "Search"
|
||||
|
||||
within('#search-officers-results') do
|
||||
within("#search-officers-results") do
|
||||
expect(page).to have_content officer1.name
|
||||
expect(page).to have_content officer2.name
|
||||
expect(page).not_to have_content officer3.name
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
feature 'Admin poll officers' do
|
||||
feature "Admin poll officers" do
|
||||
|
||||
background do
|
||||
@admin = create(:administrator)
|
||||
@user = create(:user, username: 'Pedro Jose Garcia')
|
||||
@user = create(:user, username: "Pedro Jose Garcia")
|
||||
@officer = create(:poll_officer)
|
||||
login_as(@admin.user)
|
||||
visit admin_officers_path
|
||||
end
|
||||
|
||||
scenario 'Index' do
|
||||
scenario "Index" do
|
||||
expect(page).to have_content @officer.name
|
||||
expect(page).to have_content @officer.email
|
||||
expect(page).not_to have_content @user.name
|
||||
end
|
||||
|
||||
scenario 'Create', :js do
|
||||
fill_in 'email', with: @user.email
|
||||
click_button 'Search'
|
||||
scenario "Create", :js do
|
||||
fill_in "email", with: @user.email
|
||||
click_button "Search"
|
||||
|
||||
expect(page).to have_content @user.name
|
||||
click_link 'Add'
|
||||
click_link "Add"
|
||||
within("#officers") do
|
||||
expect(page).to have_content @user.name
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Delete' do
|
||||
click_link 'Delete position'
|
||||
scenario "Delete" do
|
||||
click_link "Delete position"
|
||||
|
||||
expect(page).not_to have_css '#officers'
|
||||
expect(page).not_to have_css "#officers"
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
feature 'Answers' do
|
||||
feature "Answers" do
|
||||
|
||||
background do
|
||||
admin = create(:administrator)
|
||||
@@ -13,57 +13,57 @@ feature 'Answers' do
|
||||
%w[title],
|
||||
{ "description" => :ckeditor }
|
||||
|
||||
scenario 'Create' do
|
||||
scenario "Create" do
|
||||
question = create(:poll_question)
|
||||
title = 'Whatever the question may be, the answer is always 42'
|
||||
title = "Whatever the question may be, the answer is always 42"
|
||||
description = "The Hitchhiker's Guide To The Universe"
|
||||
|
||||
visit admin_question_path(question)
|
||||
click_link 'Add answer'
|
||||
click_link "Add answer"
|
||||
|
||||
fill_in 'Answer', with: title
|
||||
fill_in 'Description', with: description
|
||||
fill_in "Answer", with: title
|
||||
fill_in "Description", with: description
|
||||
|
||||
click_button 'Save'
|
||||
click_button "Save"
|
||||
|
||||
expect(page).to have_content(title)
|
||||
expect(page).to have_content(description)
|
||||
end
|
||||
|
||||
scenario 'Create second answer and place after the first one' do
|
||||
scenario "Create second answer and place after the first one" do
|
||||
question = create(:poll_question)
|
||||
answer = create(:poll_question_answer, title: 'First', question: question, given_order: 1)
|
||||
title = 'Second'
|
||||
answer = create(:poll_question_answer, title: "First", question: question, given_order: 1)
|
||||
title = "Second"
|
||||
description = "Description"
|
||||
|
||||
visit admin_question_path(question)
|
||||
click_link 'Add answer'
|
||||
click_link "Add answer"
|
||||
|
||||
fill_in 'Answer', with: title
|
||||
fill_in 'Description', with: description
|
||||
fill_in "Answer", with: title
|
||||
fill_in "Description", with: description
|
||||
|
||||
click_button 'Save'
|
||||
click_button "Save"
|
||||
|
||||
expect(page.body.index('First')).to be < page.body.index('Second')
|
||||
expect(page.body.index("First")).to be < page.body.index("Second")
|
||||
end
|
||||
|
||||
scenario 'Update' do
|
||||
scenario "Update" do
|
||||
question = create(:poll_question)
|
||||
answer = create(:poll_question_answer, question: question, title: "Answer title", given_order: 2)
|
||||
answer2 = create(:poll_question_answer, question: question, title: "Another title", given_order: 1)
|
||||
|
||||
visit admin_answer_path(answer)
|
||||
|
||||
click_link 'Edit answer'
|
||||
click_link "Edit answer"
|
||||
|
||||
old_title = answer.title
|
||||
new_title = 'Ex Machina'
|
||||
new_title = "Ex Machina"
|
||||
|
||||
fill_in 'Answer', with: new_title
|
||||
fill_in "Answer", with: new_title
|
||||
|
||||
click_button 'Save'
|
||||
click_button "Save"
|
||||
|
||||
expect(page).to have_content('Changes saved')
|
||||
expect(page).to have_content("Changes saved")
|
||||
expect(page).to have_content(new_title)
|
||||
|
||||
visit admin_question_path(question)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
feature 'Images' do
|
||||
feature "Images" do
|
||||
|
||||
background do
|
||||
admin = create(:administrator)
|
||||
login_as(admin.user)
|
||||
end
|
||||
|
||||
context 'Index' do
|
||||
scenario 'Answer with no images' do
|
||||
context "Index" do
|
||||
scenario "Answer with no images" do
|
||||
answer = create(:poll_question_answer,
|
||||
question: create(:poll_question))
|
||||
|
||||
@@ -17,7 +17,7 @@ feature 'Images' do
|
||||
expect(page).not_to have_css("img[title='']")
|
||||
end
|
||||
|
||||
scenario 'Answer with images' do
|
||||
scenario "Answer with images" do
|
||||
answer = create(:poll_question_answer,
|
||||
question: create(:poll_question))
|
||||
image = create(:image, imageable: answer)
|
||||
@@ -29,24 +29,24 @@ feature 'Images' do
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Add image to answer', :js do
|
||||
scenario "Add image to answer", :js do
|
||||
answer = create(:poll_question_answer,
|
||||
question: create(:poll_question))
|
||||
image = create(:image)
|
||||
|
||||
visit admin_answer_images_path(answer)
|
||||
expect(page).not_to have_css("img[title='clippy.jpg']")
|
||||
expect(page).not_to have_content('clippy.jpg')
|
||||
expect(page).not_to have_content("clippy.jpg")
|
||||
|
||||
visit new_admin_answer_image_path(answer)
|
||||
imageable_attach_new_file(image, Rails.root.join('spec/fixtures/files/clippy.jpg'))
|
||||
click_button 'Save image'
|
||||
imageable_attach_new_file(image, Rails.root.join("spec/fixtures/files/clippy.jpg"))
|
||||
click_button "Save image"
|
||||
|
||||
expect(page).to have_css("img[title='clippy.jpg']")
|
||||
expect(page).to have_content('clippy.jpg')
|
||||
expect(page).to have_content("clippy.jpg")
|
||||
end
|
||||
|
||||
scenario 'Remove image from answer', :js do
|
||||
scenario "Remove image from answer", :js do
|
||||
answer = create(:poll_question_answer,
|
||||
question: create(:poll_question))
|
||||
image = create(:image, imageable: answer)
|
||||
@@ -55,8 +55,8 @@ feature 'Images' do
|
||||
expect(page).to have_css("img[title='#{image.title}']")
|
||||
expect(page).to have_content(image.title)
|
||||
|
||||
accept_confirm 'Are you sure?' do
|
||||
click_link 'Remove image'
|
||||
accept_confirm "Are you sure?" do
|
||||
click_link "Remove image"
|
||||
end
|
||||
|
||||
expect(page).not_to have_css("img[title='#{image.title}']")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
feature 'Videos' do
|
||||
feature "Videos" do
|
||||
|
||||
background do
|
||||
admin = create(:administrator)
|
||||
@@ -21,8 +21,8 @@ feature 'Videos' do
|
||||
|
||||
click_link "Add video"
|
||||
|
||||
fill_in 'poll_question_answer_video_title', with: video_title
|
||||
fill_in 'poll_question_answer_video_url', with: video_url
|
||||
fill_in "poll_question_answer_video_title", with: video_title
|
||||
fill_in "poll_question_answer_video_url", with: video_url
|
||||
|
||||
click_button "Save"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
feature 'Admin poll questions' do
|
||||
feature "Admin poll questions" do
|
||||
|
||||
background do
|
||||
login_as(create(:administrator).user)
|
||||
@@ -11,7 +11,7 @@ feature 'Admin poll questions' do
|
||||
"edit_admin_question_path",
|
||||
%w[title]
|
||||
|
||||
scenario 'Index' do
|
||||
scenario "Index" do
|
||||
poll1 = create(:poll)
|
||||
poll2 = create(:poll)
|
||||
question1 = create(:poll_question, poll: poll1)
|
||||
@@ -30,7 +30,7 @@ feature 'Admin poll questions' do
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Show' do
|
||||
scenario "Show" do
|
||||
geozone = create(:geozone)
|
||||
poll = create(:poll, geozone_restricted: true, geozone_ids: [geozone.id])
|
||||
question = create(:poll_question, poll: poll)
|
||||
@@ -41,8 +41,8 @@ feature 'Admin poll questions' do
|
||||
expect(page).to have_content(question.author.name)
|
||||
end
|
||||
|
||||
scenario 'Create' do
|
||||
poll = create(:poll, name: 'Movies')
|
||||
scenario "Create" do
|
||||
poll = create(:poll, name: "Movies")
|
||||
title = "Star Wars: Episode IV - A New Hope"
|
||||
description = %{
|
||||
During the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the DEATH STAR, an armored space station
|
||||
@@ -54,16 +54,16 @@ feature 'Admin poll questions' do
|
||||
visit admin_questions_path
|
||||
click_link "Create question"
|
||||
|
||||
select 'Movies', from: 'poll_question_poll_id'
|
||||
fill_in 'Question', with: title
|
||||
select "Movies", from: "poll_question_poll_id"
|
||||
fill_in "Question", with: title
|
||||
|
||||
click_button 'Save'
|
||||
click_button "Save"
|
||||
|
||||
expect(page).to have_content(title)
|
||||
end
|
||||
|
||||
scenario 'Create from successful proposal' do
|
||||
poll = create(:poll, name: 'Proposals')
|
||||
scenario "Create from successful proposal" do
|
||||
poll = create(:poll, name: "Proposals")
|
||||
proposal = create(:proposal, :successful)
|
||||
|
||||
visit admin_proposal_path(proposal)
|
||||
@@ -71,18 +71,18 @@ feature 'Admin poll questions' do
|
||||
click_link "Create question"
|
||||
|
||||
expect(page).to have_current_path(new_admin_question_path, ignore_query: true)
|
||||
expect(page).to have_field('Question', with: proposal.title)
|
||||
expect(page).to have_field("Question", with: proposal.title)
|
||||
|
||||
select 'Proposals', from: 'poll_question_poll_id'
|
||||
select "Proposals", from: "poll_question_poll_id"
|
||||
|
||||
click_button 'Save'
|
||||
click_button "Save"
|
||||
|
||||
expect(page).to have_content(proposal.title)
|
||||
expect(page).to have_link(proposal.title, href: proposal_path(proposal))
|
||||
expect(page).to have_link(proposal.author.name, href: user_path(proposal.author))
|
||||
end
|
||||
|
||||
scenario 'Update' do
|
||||
scenario "Update" do
|
||||
question1 = create(:poll_question)
|
||||
|
||||
visit admin_questions_path
|
||||
@@ -92,9 +92,9 @@ feature 'Admin poll questions' do
|
||||
|
||||
old_title = question1.title
|
||||
new_title = "Potatoes are great and everyone should have one"
|
||||
fill_in 'Question', with: new_title
|
||||
fill_in "Question", with: new_title
|
||||
|
||||
click_button 'Save'
|
||||
click_button "Save"
|
||||
|
||||
expect(page).to have_content "Changes saved"
|
||||
expect(page).to have_content new_title
|
||||
@@ -105,7 +105,7 @@ feature 'Admin poll questions' do
|
||||
expect(page).not_to have_content(old_title)
|
||||
end
|
||||
|
||||
scenario 'Destroy' do
|
||||
scenario "Destroy" do
|
||||
question1 = create(:poll_question)
|
||||
question2 = create(:poll_question)
|
||||
|
||||
@@ -141,11 +141,11 @@ feature 'Admin poll questions' do
|
||||
scenario "translates the poll name in options", :js do
|
||||
visit @edit_question_url
|
||||
|
||||
expect(page).to have_select('poll_question_poll_id', options: [poll.name_en])
|
||||
expect(page).to have_select("poll_question_poll_id", options: [poll.name_en])
|
||||
|
||||
select('Español', from: 'locale-switcher')
|
||||
select("Español", from: "locale-switcher")
|
||||
|
||||
expect(page).to have_select('poll_question_poll_id', options: [poll.name_es])
|
||||
expect(page).to have_select("poll_question_poll_id", options: [poll.name_es])
|
||||
end
|
||||
|
||||
scenario "uses fallback if name is not translated to current locale", :js do
|
||||
@@ -155,11 +155,11 @@ feature 'Admin poll questions' do
|
||||
|
||||
visit @edit_question_url
|
||||
|
||||
expect(page).to have_select('poll_question_poll_id', options: [poll.name_en])
|
||||
expect(page).to have_select("poll_question_poll_id", options: [poll.name_en])
|
||||
|
||||
select('Français', from: 'locale-switcher')
|
||||
select("Français", from: "locale-switcher")
|
||||
|
||||
expect(page).to have_select('poll_question_poll_id', options: [poll.name_es])
|
||||
expect(page).to have_select("poll_question_poll_id", options: [poll.name_es])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
feature 'Admin shifts' do
|
||||
feature "Admin shifts" do
|
||||
|
||||
background do
|
||||
admin = create(:administrator)
|
||||
@@ -50,9 +50,9 @@ feature 'Admin shifts' do
|
||||
click_button "Search"
|
||||
click_link "Edit shifts"
|
||||
|
||||
expect(page).to have_select('shift_date_vote_collection_date', options: ["Select day", *vote_collection_dates])
|
||||
expect(page).not_to have_select('shift_date_recount_scrutiny_date')
|
||||
select I18n.l(Date.current, format: :long), from: 'shift_date_vote_collection_date'
|
||||
expect(page).to have_select("shift_date_vote_collection_date", options: ["Select day", *vote_collection_dates])
|
||||
expect(page).not_to have_select("shift_date_recount_scrutiny_date")
|
||||
select I18n.l(Date.current, format: :long), from: "shift_date_vote_collection_date"
|
||||
click_button "Add shift"
|
||||
|
||||
expect(page).to have_content "Shift added"
|
||||
@@ -74,11 +74,11 @@ feature 'Admin shifts' do
|
||||
click_button "Search"
|
||||
click_link "Edit shifts"
|
||||
|
||||
select "Recount & Scrutiny", from: 'shift_task'
|
||||
select "Recount & Scrutiny", from: "shift_task"
|
||||
|
||||
expect(page).to have_select('shift_date_recount_scrutiny_date', options: ["Select day", *recount_scrutiny_dates])
|
||||
expect(page).not_to have_select('shift_date_vote_collection_date')
|
||||
select I18n.l(poll.ends_at.to_date + 4.days, format: :long), from: 'shift_date_recount_scrutiny_date'
|
||||
expect(page).to have_select("shift_date_recount_scrutiny_date", options: ["Select day", *recount_scrutiny_dates])
|
||||
expect(page).not_to have_select("shift_date_vote_collection_date")
|
||||
select I18n.l(poll.ends_at.to_date + 4.days, format: :long), from: "shift_date_recount_scrutiny_date"
|
||||
click_button "Add shift"
|
||||
|
||||
expect(page).to have_content "Shift added"
|
||||
@@ -117,9 +117,9 @@ feature 'Admin shifts' do
|
||||
click_button "Search"
|
||||
click_link "Edit shifts"
|
||||
|
||||
expect(page).to have_select('shift_date_vote_collection_date', options: ["Select day", *vote_collection_dates])
|
||||
select "Recount & Scrutiny", from: 'shift_task'
|
||||
expect(page).to have_select('shift_date_recount_scrutiny_date', options: ["Select day", *recount_scrutiny_dates])
|
||||
expect(page).to have_select("shift_date_vote_collection_date", options: ["Select day", *vote_collection_dates])
|
||||
select "Recount & Scrutiny", from: "shift_task"
|
||||
expect(page).to have_select("shift_date_recount_scrutiny_date", options: ["Select day", *recount_scrutiny_dates])
|
||||
end
|
||||
|
||||
scenario "Error on create", :js do
|
||||
|
||||
Reference in New Issue
Block a user