diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 064a202cb..f03c76038 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -5,7 +5,7 @@ // 03. Show participation // 04. List participation // 05. Featured -// 06. Proposals successfull +// 06. Proposals successful // // 01. Votes and supports @@ -942,7 +942,7 @@ } } -// 06. Proposals successfull +// 06. Proposals successful // ------------------------- .dark-heading { @@ -1001,9 +1001,9 @@ } .sucessfull-proposals-banner, -.successfull .panel { +.successful .panel { - .icon-successfull { + .icon-successful { border-right: 60px solid #FFD200; border-top: 0; border-bottom: 60px solid transparent; @@ -1034,7 +1034,7 @@ } } -.successfull { +.successful { .panel { position: relative; diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb index 7d2149cad..f97334d84 100644 --- a/app/controllers/debates_controller.rb +++ b/app/controllers/debates_controller.rb @@ -22,7 +22,7 @@ class DebatesController < ApplicationController def index_customization @featured_debates = @debates.featured - @proposal_successfull_exists = Proposal.successfull.exists? + @proposal_successful_exists = Proposal.successful.exists? end def show diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index c729401aa..3bf559c17 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -28,8 +28,8 @@ class ProposalsController < ApplicationController def index_customization discard_archived load_retired - load_successfull_proposals - load_featured unless @proposal_successfull_exists + load_successful_proposals + load_featured unless @proposal_successful_exists end def vote @@ -103,8 +103,8 @@ class ProposalsController < ApplicationController end end - def load_successfull_proposals - @proposal_successfull_exists = Proposal.successfull.exists? + def load_successful_proposals + @proposal_successful_exists = Proposal.successful.exists? end end diff --git a/app/models/proposal.rb b/app/models/proposal.rb index 7bd4b7a92..75e5cbe20 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -50,7 +50,7 @@ class Proposal < ActiveRecord::Base scope :last_week, -> { where("proposals.created_at >= ?", 7.days.ago)} scope :retired, -> { where.not(retired_at: nil) } scope :not_retired, -> { where(retired_at: nil) } - scope :successfull, -> { where("cached_votes_up + physical_votes >= ?", Proposal.votes_needed_for_success)} + scope :successful, -> { where("cached_votes_up + physical_votes >= ?", Proposal.votes_needed_for_success)} def to_param "#{id}-#{title}".parameterize @@ -159,7 +159,7 @@ class Proposal < ActiveRecord::Base Setting['votes_for_proposal_success'].to_i end - def successfull? + def successful? total_votes >= Proposal.votes_needed_for_success end diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb index 7912bf421..4cee62dd3 100644 --- a/app/views/debates/index.html.erb +++ b/app/views/debates/index.html.erb @@ -29,11 +29,11 @@ <%= render "shared/banner" %> <% end %> - <% if @proposal_successfull_exists %> - <%= render "proposals/successfull_banner" %> + <% if @proposal_successful_exists %> + <%= render "proposals/successful_banner" %> <% end %> - <% unless @tag_filter || @search_terms || !has_featured? || @proposal_successfull_exists %> + <% unless @tag_filter || @search_terms || !has_featured? || @proposal_successful_exists %> <%= render "featured_debates" %> <% end %> diff --git a/app/views/proposals/_proposal.html.erb b/app/views/proposals/_proposal.html.erb index 436409580..d0a56cd20 100644 --- a/app/views/proposals/_proposal.html.erb +++ b/app/views/proposals/_proposal.html.erb @@ -1,8 +1,8 @@
<%= t("proposal_ballots.info") %>
<%= t("enquiries.banner.info") %>
- <%= t("proposals.proposal.successfull", + <%= t("proposals.proposal.successful", voting: link_to(t("proposals.proposal.voting"), polls_path)).html_safe %>
<% if can? :create, Poll::Question %> diff --git a/config/locales/en.yml b/config/locales/en.yml index d04f21e64..34cdf49e6 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -354,7 +354,7 @@ en: supports_necessary: "%{number} supports needed" total_percent: 100% archived: "This proposal has been archived and can't collect supports." - successfull: "This proposal has reached the required supports and will be voted in the %{voting}." + successful: "This proposal has reached the required supports and will be voted in the %{voting}." voting: "next voting" show: author_deleted: User deleted diff --git a/config/locales/es.yml b/config/locales/es.yml index 2ae5603d9..4e8ac8149 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -354,7 +354,7 @@ es: supports_necessary: "%{number} apoyos necesarios" total_percent: 100% archived: "Esta propuesta ha sido archivada y ya no puede recoger apoyos." - successfull: "Esta propuesta ha alcanzado los apoyos necesarios y pasará a la %{voting}." + successful: "Esta propuesta ha alcanzado los apoyos necesarios y pasará a la %{voting}." voting: "próxima votación" show: author_deleted: Usuario eliminado diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb index 7ca790f1f..07594b387 100644 --- a/db/dev_seeds.rb +++ b/db/dev_seeds.rb @@ -439,7 +439,7 @@ puts "Creating Poll Question from Proposals" puts " #{question.title} (from proposal)" end -puts "Creating Successfull Proposals" +puts "Creating Successful Proposals" (1..10).each do |i| proposal = Proposal.reorder("RANDOM()").first diff --git a/spec/features/proposal_ballots_spec.rb b/spec/features/proposal_ballots_spec.rb index 0303544d1..d602a8da7 100644 --- a/spec/features/proposal_ballots_spec.rb +++ b/spec/features/proposal_ballots_spec.rb @@ -10,7 +10,7 @@ feature 'Proposal ballots' do expect(page).to_not have_css("#next-voting") expect(page).to have_css("#featured-proposals") - create_successfull_proposals + create_successful_proposals visit proposals_path @@ -18,12 +18,12 @@ feature 'Proposal ballots' do expect(page).to_not have_css("#featured-proposals") end - scenario 'Successfull proposals do not show support buttons in index' do - successfull_proposals = create_successfull_proposals + scenario 'Successful proposals do not show support buttons in index' do + successful_proposals = create_successful_proposals visit proposals_path - successfull_proposals.each do |proposal| + successful_proposals.each do |proposal| within("#proposal_#{proposal.id}_votes") do expect(page).to_not have_css(".supports") expect(page).to have_content "This proposal has reached the required supports" @@ -31,10 +31,10 @@ feature 'Proposal ballots' do end end - scenario 'Successfull proposals do not show support buttons in show' do - successfull_proposals = create_successfull_proposals + scenario 'Successful proposals do not show support buttons in show' do + successful_proposals = create_successful_proposals - successfull_proposals.each do |proposal| + successful_proposals.each do |proposal| visit proposal_path(proposal) within("#proposal_#{proposal.id}_votes") do expect(page).to_not have_css(".supports") @@ -43,12 +43,12 @@ feature 'Proposal ballots' do end end - scenario 'Successfull proposals are listed in the proposal ballots index' do - successfull_proposals = create_successfull_proposals + scenario 'Successful proposals are listed in the proposal ballots index' do + successful_proposals = create_successful_proposals visit proposal_ballots_path - successfull_proposals.each do |proposal| + successful_proposals.each do |proposal| expect(page).to have_content(proposal.title) end end diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 91966f860..67f6ae8f6 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -1489,7 +1489,7 @@ feature 'Proposals' do end -feature 'Successfull proposals' do +feature 'Successful proposals' do scenario 'Banner shows in proposal index' do create_featured_proposals @@ -1498,7 +1498,7 @@ feature 'Successfull proposals' do expect(page).to_not have_css("#next-voting") expect(page).to have_css("#featured-proposals") - create_successfull_proposals + create_successful_proposals visit proposals_path @@ -1506,12 +1506,12 @@ feature 'Successfull proposals' do expect(page).to_not have_css("#featured-proposals") end - scenario 'Successfull proposals do not show support buttons in index' do - successfull_proposals = create_successfull_proposals + scenario 'Successful proposals do not show support buttons in index' do + successful_proposals = create_successful_proposals visit proposals_path - successfull_proposals.each do |proposal| + successful_proposals.each do |proposal| within("#proposal_#{proposal.id}_votes") do expect(page).to_not have_css(".supports") expect(page).to have_content "This proposal has reached the required supports" @@ -1519,10 +1519,10 @@ feature 'Successfull proposals' do end end - scenario 'Successfull proposals do not show support buttons in show' do - successfull_proposals = create_successfull_proposals + scenario 'Successful proposals do not show support buttons in show' do + successful_proposals = create_successful_proposals - successfull_proposals.each do |proposal| + successful_proposals.each do |proposal| visit proposal_path(proposal) within("#proposal_#{proposal.id}_votes") do expect(page).to_not have_css(".supports") @@ -1531,12 +1531,12 @@ feature 'Successfull proposals' do end end - scenario 'Successfull proposals show create enquiry button to admin users' do - successfull_proposals = create_successfull_proposals + scenario 'Successful proposals show create enquiry button to admin users' do + successful_proposals = create_successful_proposals visit proposals_path - successfull_proposals.each do |proposal| + successful_proposals.each do |proposal| within("#proposal_#{proposal.id}_votes") do expect(page).to_not have_link "Create question" end @@ -1546,7 +1546,7 @@ feature 'Successfull proposals' do visit proposals_path - successfull_proposals.each do |proposal| + successful_proposals.each do |proposal| within("#proposal_#{proposal.id}_votes") do expect(page).to have_link "Create question" end diff --git a/spec/features/users_auth_spec.rb b/spec/features/users_auth_spec.rb index 5b3c157d7..177b0c365 100644 --- a/spec/features/users_auth_spec.rb +++ b/spec/features/users_auth_spec.rb @@ -289,16 +289,16 @@ feature 'Users' do scenario 'Sign in, admin with password expired' do user = create(:user, password_changed_at: Time.now - 1.year) admin = create(:administrator, user: user) - + login_as(admin.user) visit root_path - + expect(page).to have_content "Your password is expired" fill_in 'user_current_password', with: 'judgmentday' fill_in 'user_password', with: '123456789' fill_in 'user_password_confirmation', with: '123456789' - + click_button 'Change your password' expect(page).to have_content "Password successfully updated" @@ -307,37 +307,37 @@ feature 'Users' do scenario 'Sign in, admin without password expired' do user = create(:user, password_changed_at: Time.now - 360.days) admin = create(:administrator, user: user) - + login_as(admin.user) visit root_path - expect(page).to_not have_content "Your password is expired" + expect(page).to_not have_content "Your password is expired" end scenario 'Sign in, user with password expired' do user = create(:user, password_changed_at: Time.now - 1.year) - + login_as(user) visit root_path expect(page).to_not have_content "Your password is expired" end - scenario 'Admin with password expired trying to use same password' do + scenario 'Admin with password expired trying to use same password' do user = create(:user, password_changed_at: Time.now - 1.year, password: '123456789') - admin = create(:administrator, user: user) - - login_as(admin.user) + admin = create(:administrator, user: user) + + login_as(admin.user) visit root_path - expect(page).to have_content "Your password is expired" - + expect(page).to have_content "Your password is expired" + fill_in 'user_current_password', with: 'judgmentday' - fill_in 'user_password', with: '123456789' + fill_in 'user_password', with: '123456789' fill_in 'user_password_confirmation', with: '123456789' - click_button 'Change your password' - + click_button 'Change your password' + expect(page).to have_content "must be different than the current password." - end + end end diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index 702683a5f..24c2ab286 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -192,7 +192,7 @@ module CommonActions create(:debate, :with_confidence_score, cached_votes_up: 80)] end - def create_successfull_proposals + def create_successful_proposals [create(:proposal, title: "Winter is coming", question: "Do you speak it?", cached_votes_up: Proposal.votes_needed_for_success + 100), create(:proposal, title: "Fire and blood", question: "You talking to me?", cached_votes_up: Proposal.votes_needed_for_success + 1)] end