diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 067ddfce9..0449d48f3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -216,12 +216,6 @@ Style/EmptyCaseCondition: Exclude: - 'app/models/concerns/verification.rb' -# Offense count: 29 -# Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. -Layout/ExtraSpacing: - Enabled: false - # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. diff --git a/Gemfile b/Gemfile index 245ca2a88..0f00da1ba 100644 --- a/Gemfile +++ b/Gemfile @@ -88,10 +88,10 @@ group :development, :test do gem 'quiet_assets' gem 'letter_opener_web', '~> 1.3.1' gem 'i18n-tasks', '~> 0.9.15' - gem 'capistrano', '~> 3.8.1', require: false - gem 'capistrano-bundler', '~> 1.2', require: false - gem "capistrano-rails", '~> 1.2.3', require: false - gem 'rvm1-capistrano3', require: false + gem 'capistrano', '~> 3.8.1', require: false + gem 'capistrano-bundler', '~> 1.2', require: false + gem "capistrano-rails", '~> 1.2.3', require: false + gem 'rvm1-capistrano3', require: false gem 'capistrano3-delayed-job', '~> 1.7.3' gem "bullet", '~> 5.5.1' gem "faker", '~> 1.7.3' diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb index f17afff4c..63ec8cf52 100644 --- a/app/controllers/admin/settings_controller.rb +++ b/app/controllers/admin/settings_controller.rb @@ -1,7 +1,7 @@ class Admin::SettingsController < Admin::BaseController def index - all_settings = (Setting.all).group_by { |s| s.type } + all_settings = (Setting.all).group_by { |s| s.type } @settings = all_settings['common'] @feature_flags = all_settings['feature'] @banner_styles = all_settings['banner-style'] diff --git a/app/controllers/graphql_controller.rb b/app/controllers/graphql_controller.rb index 762239dc8..5f3fd0a9f 100644 --- a/app/controllers/graphql_controller.rb +++ b/app/controllers/graphql_controller.rb @@ -36,7 +36,7 @@ class GraphqlController < ApplicationController def query_string if request.headers["CONTENT_TYPE"] == 'application/graphql' - request.body.string # request.body.class => StringIO + request.body.string # request.body.class => StringIO else params[:query] end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 07ff645e6..e99102396 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -25,7 +25,7 @@ class UsersController < ApplicationController when "proposals" then load_proposals when "debates" then load_debates when "budget_investments" then load_budget_investments - when "comments" then load_comments + when "comments" then load_comments else load_available_activity end end diff --git a/app/models/abilities/common.rb b/app/models/abilities/common.rb index 16747c8a7..71e839d3d 100644 --- a/app/models/abilities/common.rb +++ b/app/models/abilities/common.rb @@ -48,7 +48,7 @@ module Abilities can :create, Budget::Investment, budget: { phase: "accepting" } can :suggest, Budget::Investment, budget: { phase: "accepting" } can :destroy, Budget::Investment, budget: { phase: ["accepting", "reviewing"] }, author_id: user.id - can :vote, Budget::Investment, budget: { phase: "selecting" } + can :vote, Budget::Investment, budget: { phase: "selecting" } can [:show, :create], Budget::Ballot, budget: { phase: "balloting" } can [:create, :destroy], Budget::Ballot::Line, budget: { phase: "balloting" } diff --git a/app/models/activity.rb b/app/models/activity.rb index 58a91cd18..6c357d891 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -1,5 +1,5 @@ class Activity < ActiveRecord::Base - belongs_to :actionable, -> { with_hidden }, polymorphic: true + belongs_to :actionable, -> { with_hidden }, polymorphic: true belongs_to :user, -> { with_hidden } VALID_ACTIONS = %w(hide block restore valuate) diff --git a/app/models/banner.rb b/app/models/banner.rb index 2764785d1..8e816d446 100644 --- a/app/models/banner.rb +++ b/app/models/banner.rb @@ -5,7 +5,7 @@ class Banner < ActiveRecord::Base validates :title, presence: true, length: { minimum: 2 } - validates :description, presence: true + validates :description, presence: true validates :target_url, presence: true validates :style, presence: true validates :image, presence: true diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 7ba0548e2..0d9c738b9 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -60,7 +60,7 @@ class Budget scope :by_tag, ->(tag_name) { tagged_with(tag_name) } scope :by_valuator, ->(valuator_id) { where("budget_valuator_assignments.valuator_id = ?", valuator_id).joins(:valuator_assignments) } - scope :for_render, -> { includes(:heading) } + scope :for_render, -> { includes(:heading) } before_save :calculate_confidence_score before_validation :set_responsible_name diff --git a/app/models/concerns/verification.rb b/app/models/concerns/verification.rb index 88458a03d..a4770117e 100644 --- a/app/models/concerns/verification.rb +++ b/app/models/concerns/verification.rb @@ -7,7 +7,7 @@ module Verification scope :level_two_verified, -> { where("users.level_two_verified_at IS NOT NULL OR (users.confirmed_phone IS NOT NULL AND users.residence_verified_at IS NOT NULL) AND verified_at IS NULL") } scope :level_two_or_three_verified, -> { where("users.verified_at IS NOT NULL OR users.level_two_verified_at IS NOT NULL OR (users.confirmed_phone IS NOT NULL AND users.residence_verified_at IS NOT NULL)") } scope :unverified, -> { where("users.verified_at IS NULL AND (users.level_two_verified_at IS NULL AND (users.residence_verified_at IS NULL OR users.confirmed_phone IS NULL))") } - scope :incomplete_verification, -> { where("(users.residence_verified_at IS NULL AND users.failed_census_calls_count > ?) OR (users.residence_verified_at IS NOT NULL AND (users.unconfirmed_phone IS NULL OR users.confirmed_phone IS NULL))", 0) } + scope :incomplete_verification, -> { where("(users.residence_verified_at IS NULL AND users.failed_census_calls_count > ?) OR (users.residence_verified_at IS NOT NULL AND (users.unconfirmed_phone IS NULL OR users.confirmed_phone IS NULL))", 0) } end def verification_email_sent? diff --git a/app/models/poll.rb b/app/models/poll.rb index c6be3073a..6d033f514 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -18,7 +18,7 @@ class Poll < ActiveRecord::Base scope :current, -> { where('starts_at <= ? and ? <= ends_at', Time.current, Time.current) } scope :incoming, -> { where('? < starts_at', Time.current) } scope :expired, -> { where('ends_at < ?', Time.current) } - scope :published, -> { where('published = ?', true) } + scope :published, -> { where('published = ?', true) } scope :by_geozone_id, ->(geozone_id) { where(geozones: {id: geozone_id}.joins(:geozones)) } scope :sort_for_list, -> { order(:geozone_restricted, :starts_at, :name) } diff --git a/app/models/poll/null_result.rb b/app/models/poll/null_result.rb index d1724037b..bdd708504 100644 --- a/app/models/poll/null_result.rb +++ b/app/models/poll/null_result.rb @@ -2,7 +2,7 @@ class Poll::NullResult < ActiveRecord::Base VALID_ORIGINS = %w{web booth} - belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id' + belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id' belongs_to :booth_assignment belongs_to :officer_assignment diff --git a/app/models/poll/question.rb b/app/models/poll/question.rb index dd4eae3bc..a1d949d42 100644 --- a/app/models/poll/question.rb +++ b/app/models/poll/question.rb @@ -19,7 +19,7 @@ class Poll::Question < ActiveRecord::Base validates :title, length: { minimum: 4 } validates :description, length: { maximum: Poll::Question.description_max_length } - scope :by_poll_id, ->(poll_id) { where(poll_id: poll_id) } + scope :by_poll_id, ->(poll_id) { where(poll_id: poll_id) } scope :sort_for_list, -> { order('poll_questions.proposal_id IS NULL', :created_at)} scope :for_render, -> { includes(:author, :proposal) } diff --git a/app/models/poll/white_result.rb b/app/models/poll/white_result.rb index 6ca613d05..3f41795b3 100644 --- a/app/models/poll/white_result.rb +++ b/app/models/poll/white_result.rb @@ -2,7 +2,7 @@ class Poll::WhiteResult < ActiveRecord::Base VALID_ORIGINS = %w{web booth} - belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id' + belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id' belongs_to :booth_assignment belongs_to :officer_assignment diff --git a/app/models/proposal.rb b/app/models/proposal.rb index 926cbe1ee..8c7e2065a 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -38,8 +38,8 @@ class Proposal < ActiveRecord::Base before_save :calculate_hot_score, :calculate_confidence_score - scope :for_render, -> { includes(:tags) } - scope :sort_by_hot_score, -> { reorder(hot_score: :desc) } + scope :for_render, -> { includes(:tags) } + scope :sort_by_hot_score, -> { reorder(hot_score: :desc) } scope :sort_by_confidence_score, -> { reorder(confidence_score: :desc) } scope :sort_by_created_at, -> { reorder(created_at: :desc) } scope :sort_by_most_commented, -> { reorder(comments_count: :desc) } diff --git a/app/models/setting.rb b/app/models/setting.rb index 9010abba5..34c45aeed 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -2,8 +2,8 @@ class Setting < ActiveRecord::Base validates :key, presence: true, uniqueness: true default_scope { order(id: :asc) } - scope :banner_style, -> { where("key ilike ?", "banner-style.%")} - scope :banner_img, -> { where("key ilike ?", "banner-img.%")} + scope :banner_style, -> { where("key ilike ?", "banner-style.%")} + scope :banner_img, -> { where("key ilike ?", "banner-img.%")} def type if feature_flag? diff --git a/app/models/spending_proposal.rb b/app/models/spending_proposal.rb index b08d7533a..8026a3b9f 100644 --- a/app/models/spending_proposal.rb +++ b/app/models/spending_proposal.rb @@ -35,7 +35,7 @@ class SpendingProposal < ActiveRecord::Base scope :by_tag, ->(tag_name) { tagged_with(tag_name) } scope :by_valuator, ->(valuator) { where("valuation_assignments.valuator_id = ?", valuator.presence).joins(:valuation_assignments) } - scope :for_render, -> { includes(:geozone) } + scope :for_render, -> { includes(:geozone) } before_validation :set_responsible_name diff --git a/bin/setup b/bin/setup index acdb2c138..d3bb99760 100755 --- a/bin/setup +++ b/bin/setup @@ -2,7 +2,7 @@ require 'pathname' # path to your application root. -APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) Dir.chdir APP_ROOT do # This script is a starting point to setup your application. diff --git a/spec/controllers/management/sessions_controller_spec.rb b/spec/controllers/management/sessions_controller_spec.rb index ec8f762d9..0e2a18544 100644 --- a/spec/controllers/management/sessions_controller_spec.rb +++ b/spec/controllers/management/sessions_controller_spec.rb @@ -44,7 +44,7 @@ describe Management::SessionsController do describe 'Sign out' do it "should destroy the session data and redirect" do session[:manager] = {user_key: "31415926", date: "20151031135905", login: "JJB033"} - session[:document_type] = "1" + session[:document_type] = "1" session[:document_number] = "12345678Z" delete :destroy diff --git a/spec/controllers/management/users_controller_spec.rb b/spec/controllers/management/users_controller_spec.rb index 8fb41128a..221d302b6 100644 --- a/spec/controllers/management/users_controller_spec.rb +++ b/spec/controllers/management/users_controller_spec.rb @@ -5,7 +5,7 @@ describe Management::UsersController do describe 'logout' do it "should remove user data from the session" do session[:manager] = {user_key: "31415926", date: "20151031135905", login: "JJB033"} - session[:document_type] = "1" + session[:document_type] = "1" session[:document_number] = "12345678Z" get :logout diff --git a/spec/factories.rb b/spec/factories.rb index 7397669bd..18df18120 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -258,7 +258,7 @@ FactoryGirl.define do end factory :budget_investment, class: 'Budget::Investment' do - sequence(:title) { |n| "Budget Investment #{n} title" } + sequence(:title) { |n| "Budget Investment #{n} title" } association :heading, factory: :budget_heading association :author, factory: :user description 'Spend money on this' @@ -585,7 +585,7 @@ FactoryGirl.define do factory :banner do sequence(:title) { |n| "Banner title #{n}" } - sequence(:description) { |n| "This is the text of Banner #{n}" } + sequence(:description) { |n| "This is the text of Banner #{n}" } style {["banner-style-one", "banner-style-two", "banner-style-three"].sample} image {["banner.banner-img-one", "banner.banner-img-two", "banner.banner-img-three"].sample} target_url {["/proposals", "/debates" ].sample} diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb index f8110b614..dfb64a755 100644 --- a/spec/features/budgets/investments_spec.rb +++ b/spec/features/budgets/investments_spec.rb @@ -5,7 +5,7 @@ feature 'Budget Investments' do let(:author) { create(:user, :level_two, username: 'Isabel') } let(:budget) { create(:budget, name: "Big Budget") } let(:other_budget) { create(:budget, name: "What a Budget!") } - let(:group) { create(:budget_group, name: "Health", budget: budget) } + let(:group) { create(:budget_group, name: "Health", budget: budget) } let!(:heading) { create(:budget_heading, name: "More hospitals", group: group) } scenario 'Index' do @@ -641,11 +641,11 @@ feature 'Budget Investments' do carabanchel_heading = create(:budget_heading, group: group, name: "Carabanchel") new_york_heading = create(:budget_heading, group: group, name: "New York") - sp1 = create(:budget_investment, :selected, price: 1, heading: global_heading) - sp2 = create(:budget_investment, :selected, price: 10, heading: global_heading) - sp3 = create(:budget_investment, :selected, price: 100, heading: global_heading) - sp4 = create(:budget_investment, :selected, price: 1000, heading: carabanchel_heading) - sp5 = create(:budget_investment, :selected, price: 10000, heading: carabanchel_heading) + sp1 = create(:budget_investment, :selected, price: 1, heading: global_heading) + sp2 = create(:budget_investment, :selected, price: 10, heading: global_heading) + sp3 = create(:budget_investment, :selected, price: 100, heading: global_heading) + sp4 = create(:budget_investment, :selected, price: 1000, heading: carabanchel_heading) + sp5 = create(:budget_investment, :selected, price: 10000, heading: carabanchel_heading) sp6 = create(:budget_investment, :selected, price: 100000, heading: new_york_heading) login_as(user) diff --git a/spec/features/comments/budget_investments_spec.rb b/spec/features/comments/budget_investments_spec.rb index 73e1b0869..7e96b1f80 100644 --- a/spec/features/comments/budget_investments_spec.rb +++ b/spec/features/comments/budget_investments_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' include ActionView::Helpers::DateHelper feature 'Commenting Budget::Investments' do - let(:user) { create :user } + let(:user) { create :user } let(:investment) { create :budget_investment } scenario 'Index' do diff --git a/spec/features/comments/legislation_annotations_spec.rb b/spec/features/comments/legislation_annotations_spec.rb index d8c539201..7727d8204 100644 --- a/spec/features/comments/legislation_annotations_spec.rb +++ b/spec/features/comments/legislation_annotations_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' include ActionView::Helpers::DateHelper feature 'Commenting legislation questions' do - let(:user) { create :user } + let(:user) { create :user } let(:legislation_annotation) { create :legislation_annotation, author: user } scenario 'Index' do diff --git a/spec/features/comments/legislation_questions_spec.rb b/spec/features/comments/legislation_questions_spec.rb index 4bdaed1ee..064a72ae0 100644 --- a/spec/features/comments/legislation_questions_spec.rb +++ b/spec/features/comments/legislation_questions_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' include ActionView::Helpers::DateHelper feature 'Commenting legislation questions' do - let(:user) { create :user, :level_two } + let(:user) { create :user, :level_two } let(:process) { create :legislation_process, :in_debate_phase } let(:legislation_question) { create :legislation_question, process: process } diff --git a/spec/features/comments/proposals_spec.rb b/spec/features/comments/proposals_spec.rb index ad088b79a..d10a11de7 100644 --- a/spec/features/comments/proposals_spec.rb +++ b/spec/features/comments/proposals_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' include ActionView::Helpers::DateHelper feature 'Commenting proposals' do - let(:user) { create :user } + let(:user) { create :user } let(:proposal) { create :proposal } scenario 'Index' do diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 3c90171e9..b1357bb1c 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -674,7 +674,7 @@ feature 'Debates' do click_link "Advanced search" fill_in "Write the text", with: "Schwifty" select Setting['official_level_1_name'], from: "advanced_search_official_level" - select "Last 24 hours", from: "js-advanced-search-date-min" + select "Last 24 hours", from: "js-advanced-search-date-min" click_button "Filter" @@ -866,10 +866,10 @@ feature 'Debates' do login_as(author) 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) + 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) diff --git a/spec/features/organizations_spec.rb b/spec/features/organizations_spec.rb index 0a7a2bcc7..f968d6cac 100644 --- a/spec/features/organizations_spec.rb +++ b/spec/features/organizations_spec.rb @@ -8,7 +8,7 @@ feature 'Organizations' do visit new_organization_registration_path - fill_in 'user_organization_attributes_name', with: 'Greenpeace' + fill_in 'user_organization_attributes_name', with: 'Greenpeace' fill_in 'user_organization_attributes_responsible_name', with: 'Dorothy Stowe' fill_in 'user_email', with: 'green@peace.com' fill_in 'user_password', with: 'greenpeace' @@ -45,7 +45,7 @@ feature 'Organizations' do scenario 'Create organization too fast' do allow(InvisibleCaptcha).to receive(:timestamp_threshold).and_return(Float::INFINITY) visit new_organization_registration_path - fill_in 'user_organization_attributes_name', with: 'robot' + fill_in 'user_organization_attributes_name', with: 'robot' fill_in 'user_organization_attributes_responsible_name', with: 'Robots are more responsible than humans' fill_in 'user_email', with: 'robot@robot.com' fill_in 'user_password', with: 'destroyallhumans' diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index cfe9cc918..99f7cbfed 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -89,7 +89,7 @@ feature 'Proposals' do end end - context "Embedded video" do + context "Embedded video" do scenario "Show YouTube video" do proposal = create(:proposal, video_url: "http://www.youtube.com/watch?v=a7UFm6ErMPU") @@ -1072,7 +1072,7 @@ feature 'Proposals' do click_link "Advanced search" fill_in "Write the text", with: "Schwifty" select Setting['official_level_1_name'], from: "advanced_search_official_level" - select "Last 24 hours", from: "js-advanced-search-date-min" + select "Last 24 hours", from: "js-advanced-search-date-min" click_button "Filter" diff --git a/spec/lib/age_spec.rb b/spec/lib/age_spec.rb index 6e1012fd4..02637966e 100644 --- a/spec/lib/age_spec.rb +++ b/spec/lib/age_spec.rb @@ -17,7 +17,7 @@ describe Age do d = Date.new(1980, 12, 31) expect(Age.in_years(d, Date.new(2000, 12, 30))).to eq(19) expect(Age.in_years(d, Date.new(2000, 12, 31))).to eq(20) - expect(Age.in_years(d, Date.new(2001, 1, 1))).to eq(20) + expect(Age.in_years(d, Date.new(2001, 1, 1))).to eq(20) d = Date.new(1980, 1, 1) expect(Age.in_years(d, Date.new(2000, 12, 31))).to eq(20) @@ -31,28 +31,28 @@ describe Age do expect(Age.in_years(d, Date.new(2000, 2, 27))).to eq(19) expect(Age.in_years(d, Date.new(2000, 2, 28))).to eq(19) expect(Age.in_years(d, Date.new(2000, 2, 29))).to eq(20) - expect(Age.in_years(d, Date.new(2000, 3, 1))).to eq(20) + expect(Age.in_years(d, Date.new(2000, 3, 1))).to eq(20) expect(Age.in_years(d, Date.new(2001, 2, 27))).to eq(20) expect(Age.in_years(d, Date.new(2001, 2, 28))).to eq(20) - expect(Age.in_years(d, Date.new(2001, 3, 1))).to eq(21) + expect(Age.in_years(d, Date.new(2001, 3, 1))).to eq(21) d = Date.new(1980, 2, 28) expect(Age.in_years(d, Date.new(2000, 2, 27))).to eq(19) expect(Age.in_years(d, Date.new(2000, 2, 28))).to eq(20) expect(Age.in_years(d, Date.new(2000, 2, 29))).to eq(20) - expect(Age.in_years(d, Date.new(2000, 3, 1))).to eq(20) + expect(Age.in_years(d, Date.new(2000, 3, 1))).to eq(20) expect(Age.in_years(d, Date.new(2001, 2, 27))).to eq(20) expect(Age.in_years(d, Date.new(2001, 2, 28))).to eq(21) - expect(Age.in_years(d, Date.new(2001, 3, 1))).to eq(21) + expect(Age.in_years(d, Date.new(2001, 3, 1))).to eq(21) d = Date.new(1980, 3, 1) expect(Age.in_years(d, Date.new(2000, 2, 27))).to eq(19) expect(Age.in_years(d, Date.new(2000, 2, 28))).to eq(19) expect(Age.in_years(d, Date.new(2000, 2, 29))).to eq(19) - expect(Age.in_years(d, Date.new(2000, 3, 1))).to eq(20) + expect(Age.in_years(d, Date.new(2000, 3, 1))).to eq(20) expect(Age.in_years(d, Date.new(2001, 2, 27))).to eq(20) expect(Age.in_years(d, Date.new(2001, 2, 28))).to eq(20) - expect(Age.in_years(d, Date.new(2001, 3, 1))).to eq(21) + expect(Age.in_years(d, Date.new(2001, 3, 1))).to eq(21) end end end diff --git a/spec/lib/graph_ql/query_type_creator_spec.rb b/spec/lib/graph_ql/query_type_creator_spec.rb index 6d3fe7a2a..be223c109 100644 --- a/spec/lib/graph_ql/query_type_creator_spec.rb +++ b/spec/lib/graph_ql/query_type_creator_spec.rb @@ -7,7 +7,7 @@ describe GraphQL::QueryTypeCreator do Proposal => { fields: { id: :integer, title: :string } } } end - let(:api_types) { GraphQL::ApiTypesCreator.create(api_type_definitions) } + let(:api_types) { GraphQL::ApiTypesCreator.create(api_type_definitions) } describe "::create" do let(:query_type) { GraphQL::QueryTypeCreator.create(api_types) } diff --git a/spec/models/abilities/common_spec.rb b/spec/models/abilities/common_spec.rb index f5e3a6599..da398e610 100644 --- a/spec/models/abilities/common_spec.rb +++ b/spec/models/abilities/common_spec.rb @@ -35,14 +35,14 @@ describe "Abilities::Common" do let(:incoming_poll) { create(:poll, :incoming) } let(:incoming_poll_from_own_geozone) { create(:poll, :incoming, geozone_restricted: true, geozones: [geozone]) } let(:incoming_poll_from_other_geozone) { create(:poll, :incoming, geozone_restricted: true, geozones: [create(:geozone)]) } - let(:expired_poll) { create(:poll, :expired) } + let(:expired_poll) { create(:poll, :expired) } let(:expired_poll_from_own_geozone) { create(:poll, :expired, geozone_restricted: true, geozones: [geozone]) } let(:expired_poll_from_other_geozone) { create(:poll, :expired, geozone_restricted: true, geozones: [create(:geozone)]) } let(:poll) { create(:poll, geozone_restricted: false) } let(:poll_from_own_geozone) { create(:poll, geozone_restricted: true, geozones: [geozone]) } let(:poll_from_other_geozone) { create(:poll, geozone_restricted: true, geozones: [create(:geozone)]) } - let(:poll_question_from_own_geozone) { create(:poll_question, poll: poll_from_own_geozone) } + let(:poll_question_from_own_geozone) { create(:poll_question, poll: poll_from_own_geozone) } let(:poll_question_from_other_geozone) { create(:poll_question, poll: poll_from_other_geozone) } let(:poll_question_from_all_geozones) { create(:poll_question, poll: poll) } @@ -222,7 +222,7 @@ describe "Abilities::Common" do it { should be_able_to(:vote, Proposal) } it { should be_able_to(:vote_featured, Proposal) } - it { should be_able_to(:create, SpendingProposal) } + it { should be_able_to(:create, SpendingProposal) } it { should_not be_able_to(:destroy, create(:spending_proposal)) } it { should_not be_able_to(:destroy, own_spending_proposal) } diff --git a/spec/models/letter_spec.rb b/spec/models/letter_spec.rb index fdec7f390..eca9f815e 100644 --- a/spec/models/letter_spec.rb +++ b/spec/models/letter_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' describe 'Verification::Letter' do - let(:user) { create(:user) } + let(:user) { create(:user) } describe "validations" do diff --git a/spec/models/poll/poll_spec.rb b/spec/models/poll/poll_spec.rb index 80a57e916..61f9fce52 100644 --- a/spec/models/poll/poll_spec.rb +++ b/spec/models/poll/poll_spec.rb @@ -93,7 +93,7 @@ describe :poll do let(:non_user) { nil } let(:level1) { create(:user) } let(:level2) { create(:user, :level_two) } - let(:level2_from_geozone) { create(:user, :level_two, geozone: geozone) } + let(:level2_from_geozone) { create(:user, :level_two, geozone: geozone) } let(:all_users) { [non_user, level1, level2, level2_from_geozone] } describe 'instance method' do diff --git a/spec/models/tag_cloud_spec.rb b/spec/models/tag_cloud_spec.rb index 5de136ae1..7b84154dc 100644 --- a/spec/models/tag_cloud_spec.rb +++ b/spec/models/tag_cloud_spec.rb @@ -24,7 +24,7 @@ describe TagCloud do it "returns budget investment tags" do create(:budget_investment, tag_list: 'participation') - create(:debate, tag_list: 'world hunger') + create(:debate, tag_list: 'world hunger') tag_cloud = TagCloud.new(Budget::Investment)