Fix more hound warnings
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
describe "Retrieves achievements for a proposal" do
|
||||
describe Dashboard::AchievementsController do
|
||||
let(:created_at) { DateTime.parse("2018-01-01 12:00:00") }
|
||||
let(:proposal) { create(:proposal, created_at: created_at) }
|
||||
let(:executed_actions) { create_list(:dashboard_action, 8, :active, :proposed_action) }
|
||||
@@ -10,7 +10,8 @@ describe "Retrieves achievements for a proposal" do
|
||||
sign_in(proposal.author)
|
||||
|
||||
executed_actions.each_with_index do |action, index|
|
||||
create(:dashboard_executed_action, proposal: proposal, action: action, executed_at: proposal.created_at + index.days)
|
||||
create(:dashboard_executed_action, proposal: proposal, action: action,
|
||||
executed_at: proposal.created_at + index.days)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -32,7 +33,7 @@ describe "Retrieves achievements for a proposal" do
|
||||
end
|
||||
|
||||
it "returns a list of most recent executed achievements grouped by week" do
|
||||
get proposal_dashboard_achievements_path(proposal, group_by: 'week', format: :json)
|
||||
get proposal_dashboard_achievements_path(proposal, group_by: "week", format: :json)
|
||||
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
@@ -41,7 +42,7 @@ describe "Retrieves achievements for a proposal" do
|
||||
end
|
||||
|
||||
it "returns a list of most recent executed achievements grouped by month" do
|
||||
get proposal_dashboard_achievements_path(proposal, group_by: 'month', format: :json)
|
||||
get proposal_dashboard_achievements_path(proposal, group_by: "month", format: :json)
|
||||
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
describe "Retrieves number of supports for the successful proposal" do
|
||||
let(:created_at) { Time.now.beginning_of_day - 9.days }
|
||||
let(:proposal) { create(:proposal, created_at: created_at, published_at: created_at) }
|
||||
|
||||
before do
|
||||
@successful_proposal_id = Setting['proposals.successful_proposal_id']
|
||||
Setting['proposals.successful_proposal_id'] = proposal.id
|
||||
@successful_proposal_id = Setting["proposals.successful_proposal_id"]
|
||||
Setting["proposals.successful_proposal_id"] = proposal.id
|
||||
|
||||
8.times do |i|
|
||||
user = create(:user, :verified)
|
||||
Vote.create!(
|
||||
votable: proposal,
|
||||
voter: user,
|
||||
vote_weight: 1,
|
||||
created_at: proposal.created_at + i.days,
|
||||
votable: proposal,
|
||||
voter: user,
|
||||
vote_weight: 1,
|
||||
created_at: proposal.created_at + i.days,
|
||||
updated_at: proposal.created_at + i.days
|
||||
)
|
||||
end
|
||||
@@ -23,7 +23,7 @@ describe "Retrieves number of supports for the successful proposal" do
|
||||
end
|
||||
|
||||
after do
|
||||
Setting['proposals.successful_proposal_id'] = @successful_proposal_id
|
||||
Setting["proposals.successful_proposal_id"] = @successful_proposal_id
|
||||
end
|
||||
|
||||
it "returns the number of supports grouped by day" do
|
||||
@@ -37,7 +37,7 @@ describe "Retrieves number of supports for the successful proposal" do
|
||||
end
|
||||
|
||||
it "returns the number of supports grouped by week" do
|
||||
get proposal_dashboard_successful_supports_path(proposal, group_by: 'week', format: :json)
|
||||
get proposal_dashboard_successful_supports_path(proposal, group_by: "week", format: :json)
|
||||
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
@@ -48,7 +48,7 @@ describe "Retrieves number of supports for the successful proposal" do
|
||||
end
|
||||
|
||||
it "returns the number of supports grouped by month" do
|
||||
get proposal_dashboard_successful_supports_path(proposal, group_by: 'month', format: :json)
|
||||
get proposal_dashboard_successful_supports_path(proposal, group_by: "month", format: :json)
|
||||
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
require 'rails_helper'
|
||||
require "rails_helper"
|
||||
|
||||
describe "Retrieves number of supports for a proposal" do
|
||||
describe Dashboard::GroupSupports do
|
||||
let(:created_at) { Time.now - 9.days }
|
||||
let(:proposal) { create(:proposal, created_at: created_at, published_at: created_at) }
|
||||
|
||||
before do
|
||||
8.times do |i|
|
||||
user = create(:user, :verified)
|
||||
Vote.create!(votable: proposal, voter: user, vote_weight: 1, created_at: proposal.created_at + i.days, updated_at: proposal.created_at + i.days)
|
||||
Vote.create!(votable: proposal, voter: user, vote_weight: 1,
|
||||
created_at: proposal.created_at + i.days,
|
||||
updated_at: proposal.created_at + i.days)
|
||||
end
|
||||
|
||||
sign_in(proposal.author)
|
||||
@@ -24,7 +26,7 @@ describe "Retrieves number of supports for a proposal" do
|
||||
end
|
||||
|
||||
it "returns the number of supports grouped by week" do
|
||||
get proposal_dashboard_supports_path(proposal, group_by: 'week', format: :json)
|
||||
get proposal_dashboard_supports_path(proposal, group_by: "week", format: :json)
|
||||
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
@@ -35,7 +37,7 @@ describe "Retrieves number of supports for a proposal" do
|
||||
end
|
||||
|
||||
it "returns the number of supports grouped by month" do
|
||||
get proposal_dashboard_supports_path(proposal, group_by: 'month', format: :json)
|
||||
get proposal_dashboard_supports_path(proposal, group_by: "month", format: :json)
|
||||
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user