🚨Fix Rubocop lint errors

This commit is contained in:
Pranav Raj S
2019-10-20 14:17:26 +05:30
committed by GitHub
parent dd018f3682
commit 94c6d6db6f
124 changed files with 774 additions and 914 deletions

View File

@@ -4,12 +4,9 @@ FactoryBot.define do
factory :contact do
sequence(:name) { |n| "Widget #{n}" }
sequence(:email) { |n| "widget-#{n}@example.com" }
phone_number { "+123456789011" }
phone_number { '+123456789011' }
source_id { rand(100) }
account
inbox
end
end

View File

@@ -4,6 +4,6 @@ FactoryBot.define do
factory :inbox do
account
association :channel, factory: :channel_widget
name { "Inbox" }
name { 'Inbox' }
end
end

View File

@@ -9,10 +9,10 @@ FactoryBot.define do
provider { 'email' }
uid { SecureRandom.uuid }
name { Faker::Name.name }
nickname { Faker::Name.first_name }
nickname { Faker::Name.first_name }
email { nickname + '@example.com' }
role { 'agent' }
password { "password" }
password { 'password' }
account
after(:build) do |user, evaluator|

View File

@@ -1,16 +1,16 @@
require "rails_helper"
require 'rails_helper'
describe FrontendUrlsHelper, type: :helper do
describe "#frontend_url" do
context "without query params" do
it "creates path correctly" do
expect(helper.frontend_url('dashboard')).to eq "http://test.host/app/dashboard"
describe '#frontend_url' do
context 'without query params' do
it 'creates path correctly' do
expect(helper.frontend_url('dashboard')).to eq 'http://test.host/app/dashboard'
end
end
context "with query params" do
it "creates path correctly" do
expect(helper.frontend_url('dashboard', p1: 'p1', p2: 'p2')).to eq "http://test.host/app/dashboard?p1=p1&p2=p2"
context 'with query params' do
it 'creates path correctly' do
expect(helper.frontend_url('dashboard', p1: 'p1', p2: 'p2')).to eq 'http://test.host/app/dashboard?p1=p1&p2=p2'
end
end
end

View File

@@ -1,6 +1,6 @@
# frozen_string_literal: true
require 'rails_helper'
require 'rails_helper'
RSpec.describe 'Confirmation Instructions', type: :mailer do
describe :notify do

View File

@@ -1,8 +1,8 @@
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require File.expand_path('../config/environment', __dir__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
abort('The Rails environment is running in production mode!') if Rails.env.production?
require 'rspec/rails'
# Add additional requires below this line. Rails is not loaded until this point!

View File

@@ -1,4 +1,3 @@
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
@@ -11,5 +10,4 @@ RSpec.configure do |config|
config.shared_context_metadata_behavior = :apply_to_host_groups
# config.include Rails.application.routes.url_helpers
end

View File

@@ -1,5 +1,5 @@
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require File.expand_path('../config/environment', __dir__)
require 'rails/test_help'
class ActiveSupport::TestCase