Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
doolin committed Nov 1, 2015
1 parent 695690f commit b1c8c4c
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 39 deletions.
12 changes: 1 addition & 11 deletions .rubocop_todo.yml
Expand Up @@ -191,17 +191,7 @@ Style/IndentationWidth:
# Offense count: 28
# Cop supports --auto-correct.
Style/LeadingCommentSpace:
Exclude:
- 'app/controllers/admins_controller.rb'
- 'app/controllers/email_contacts_controller.rb'
- 'app/mailers/contact_mailer.rb'
- 'config/application.rb'
- 'config/routes.rb'
- 'features/step_definitions/login_steps.rb'
- 'features/step_definitions/sendmessage_steps.rb'
- 'features/support/env.rb'
- 'spec/controllers/email_contacts_controller_spec.rb'
- 'spec/mailers/contact_mailer_spec.rb'
Enabled: true

# Offense count: 2
# Cop supports --auto-correct.
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admins_controller.rb
@@ -1,7 +1,7 @@
class AdminsController < ApplicationController

def new
#redirect_to root_path
# redirect_to root_path
end

=begin
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/email_contacts_controller.rb
Expand Up @@ -60,14 +60,14 @@ def create

respond_to do |format|
if @email_contact.save
#ContactMailer.welcome_email(@email_contact).deliver
# ContactMailer.welcome_email(@email_contact).deliver
ContactMailer.contacts_copy(@email_contact).deliver
ContactMailer.daves_copy(@email_contact).deliver
#format.html { redirect_to(thankyou_path, :notice => 'Email contact was successfully created.') }
format.html { redirect_to thankyou_path } #{ redirect_to(thankyou_path, :notice => 'Email contact was successfully created.') }
# format.html { redirect_to(thankyou_path, :notice => 'Email contact was successfully created.') }
format.html { redirect_to thankyou_path } # { redirect_to(thankyou_path, :notice => 'Email contact was successfully created.') }
format.xml { render :xml => @email_contact, :status => :created, :location => @email_contact }

#redirect_to thankyou_path
# redirect_to thankyou_path

else
format.html { render :action => 'new' }
Expand All @@ -94,7 +94,7 @@ def update

def thankyou
@thanks = 'Come back soon!'
#redirect_to thankyou_path
# redirect_to thankyou_path
render('email_contacts/thankyou')
end

Expand Down
4 changes: 2 additions & 2 deletions app/mailers/contact_mailer.rb
@@ -1,11 +1,11 @@
class ContactMailer < ActionMailer::Base

#default :to => "david.doolin@gmail.com"
# default :to => "david.doolin@gmail.com"

# TODO: Add URL to emails, then delete welcome_email method
def welcome_email(user)
@user = user
#@url = "http://example.com/login"
# @url = "http://example.com/login"
mail(:from => @user.email,
:cc => @user.email,
:reply_to => @user.email,
Expand Down
8 changes: 4 additions & 4 deletions config/application.rb
Expand Up @@ -2,7 +2,7 @@

require 'rails/all'

#require 'action_mailer'
# require 'action_mailer'

# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Expand All @@ -16,11 +16,11 @@ class Application < Rails::Application

# From http://www.ruby-forum.com/topic/184533
# Trying to fix a "stack too deep" issue
#config.cache_classes = false
#config.cache_classes = true
# config.cache_classes = false
# config.cache_classes = true

# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
#config.action_mailer.default_url_options = { :host => 'localhost:3000' }
# config.action_mailer.default_url_options = { :host => 'localhost:3000' }
end
end
4 changes: 2 additions & 2 deletions config/routes.rb
Expand Up @@ -2,10 +2,10 @@

resources :email_contacts

#get "email_contacts/thankyou"
# get "email_contacts/thankyou"

match '/thankyou', :to => 'email_contacts#thankyou'
#match "/admins/sign_up", :to => 'email_contacts#new'
# match "/admins/sign_up", :to => 'email_contacts#new'

root :to => 'email_contacts#new'

Expand Down
8 changes: 4 additions & 4 deletions features/step_definitions/login_steps.rb
Expand Up @@ -46,7 +46,7 @@
password = 'secretpass'

Given %{I have one admin "#{email}" with password "#{password}" and login "#{login}"}
And %{I go to the admin's sign_in page} #And %{I go to login}
And %{I go to the admin's sign_in page} # And %{I go to login}
And %{I fill in "admin_email" with "#{email}"}
And %{I fill in "admin_password" with "#{password}"}
And %{I press "Sign in"}
Expand All @@ -62,9 +62,9 @@
end
=end

#Given /^I fill in the "([^"]*)" with "([^"]*)"$/ do |arg1, arg2|
# Given /^I fill in the "([^"]*)" with "([^"]*)"$/ do |arg1, arg2|
# pending # express the regexp above with the code you wish you had
#end
# end

# This isn't quite right, should use an already created admin
# and log that admin in.
Expand All @@ -76,7 +76,7 @@
# This is currently failing because there are no emails
# in the email_contacts list.
Given /^I click on the email "Delete" link$/ do
#save_and_open_page
# save_and_open_page
click_link('Delete')
# pending # express the regexp above with the code you wish you had
end
Expand Down
10 changes: 5 additions & 5 deletions features/step_definitions/sendmessage_steps.rb
Expand Up @@ -2,13 +2,13 @@

Given /^I'm on the message sending form page$/ do
visit('/')
#pending # express the regexp above with the code you wish you had
# pending # express the regexp above with the code you wish you had
end


#Given /^there's a message sending form web page$/ do
# Given /^there's a message sending form web page$/ do
# pending # express the regexp above with the code you wish you had
#end
# end

When /^the user sends a message$/ do
pending # express the regexp above with the code you wish you had
Expand All @@ -18,10 +18,10 @@
pending # express the regexp above with the code you wish you had
end

#Given /^I fill in the "([^"]*)" field$/ do |value|
# Given /^I fill in the "([^"]*)" field$/ do |value|
# fill_in(field, :with => value)
# #pending # express the regexp above with the code you wish you had
#end
# end

Then /^Dave should get my email$/ do
pending # express the regexp above with the code you wish you had
Expand Down
4 changes: 2 additions & 2 deletions features/support/env.rb
Expand Up @@ -6,8 +6,8 @@

require 'cucumber/rails'

#require 'email_spec'
#require 'email_spec/cucumber'
# require 'email_spec'
# require 'email_spec/cucumber'


# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/email_contacts_controller_spec.rb
Expand Up @@ -33,7 +33,7 @@ def mock_email_contact(stubs={})

describe 'GET index' do
it 'assigns all email_contacts as @email_contacts' do
#EmailContact.stub(:all) { [mock_email_contact] }
# EmailContact.stub(:all) { [mock_email_contact] }
EmailContact.stub(:all) { mock_email_contact }
get :index
assigns(:email_contacts).should eq(@mock_email_contact)
Expand All @@ -45,7 +45,7 @@ def mock_email_contact(stubs={})
it 'assigns the requested email_contact as @email_contact' do
EmailContact.stub(:find).with('37') { mock_email_contact }
get :show, :id => '37'
#assigns(:email_contact).should be(mock_email_contact)
# assigns(:email_contact).should be(mock_email_contact)
assigns(:email_contact).should == @mock_email_contact
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/mailers/contact_mailer_spec.rb
Expand Up @@ -15,7 +15,7 @@
# The from field is overriden by Google, let's
# test it here so that it will work when outgoing
# SMTP server is changed to something else.
#mail.from.should eq([@email_contact.email])
# mail.from.should eq([@email_contact.email])
end

it 'renders the body' do
Expand Down

0 comments on commit b1c8c4c

Please sign in to comment.