Skip to content

Commit

Permalink
Rails 4.2 updates. Fixes #50
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Dutil authored and Jeff Dutil committed Jan 15, 2015
1 parent 93fc9cc commit b08a362
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
## ContactUs 1.0.0 (Jan 15th 2015)

* Fix Rails 4.2 deliver_later deprecation.
* Require Ruby 2+

## ContactUs 0.5.4 (Jun 25th 2014)

* Added Greek locale.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,4 +1,4 @@
source "http://rubygems.org"
source "https://rubygems.org"

# Specify your gem's dependencies in contact_us.gemspec
gemspec
2 changes: 1 addition & 1 deletion app/models/contact_us/contact.rb
Expand Up @@ -18,7 +18,7 @@ def initialize(attributes = {})

def save
if self.valid?
ContactUs::ContactMailer.contact_email(self).deliver
ContactUs::ContactMailer.contact_email(self).deliver_now
return true
end
return false
Expand Down
6 changes: 3 additions & 3 deletions contact_us.gemspec
Expand Up @@ -12,20 +12,20 @@ Gem::Specification.new do |s|
s.summary = %q{Gem providing simple Contact Us functionality with a Rails 3+ Engine.}
s.description = %q{A Rails 3+ Engine providing a basic contact form. I used Formtastic to keep things simple, and to hook into your apps custom Formtastic stylesheets.}

s.required_ruby_version = '>= 1.9.3'
s.required_ruby_version = '>= 2.0.0'
s.rubyforge_project = "contact_us"

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ["lib"]

s.add_development_dependency "capybara", "~> 2.0"
s.add_development_dependency "rspec-rails", "~> 2.13"
s.add_development_dependency "rspec-rails", "~> 2.99"
s.add_development_dependency "shoulda-matchers", ">= 1.5.4"
s.add_development_dependency "simplecov", "~> 0.7"
s.add_development_dependency "sqlite3", "~> 1.3.5"
s.add_development_dependency "formtastic", ">= 2.1.0"
s.add_development_dependency "simple_form"

s.add_runtime_dependency "rails", ">= 4.0.0"
s.add_runtime_dependency "rails", ">= 4.2.0"
end
2 changes: 1 addition & 1 deletion lib/contact_us/version.rb
@@ -1,3 +1,3 @@
module ContactUs
VERSION = "0.5.4"
VERSION = "1.0.0"
end
4 changes: 2 additions & 2 deletions spec/mailers/contact_us/contact_mailer_spec.rb
Expand Up @@ -47,13 +47,13 @@
end

it "should deliver successfully" do
lambda { ContactUs::ContactMailer.contact_email(@contact).deliver }.should_not raise_error
lambda { ContactUs::ContactMailer.contact_email(@contact).deliver_now }.should_not raise_error
end

describe "and delivered" do

it "should be added to the delivery queue" do
lambda { ContactUs::ContactMailer.contact_email(@contact).deliver }.should change(ActionMailer::Base.deliveries,:size).by(1)
lambda { ContactUs::ContactMailer.contact_email(@contact).deliver_now }.should change(ActionMailer::Base.deliveries,:size).by(1)
end

end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/contact_us/contact_spec.rb
Expand Up @@ -48,7 +48,7 @@

it 'should send email and return true if records valid' do
mail = Mail.new(:from=>"Valid@Email.com", :to => "test@test.com")
mail.stub(:deliver).and_return(true)
mail.stub(:deliver_now).and_return(true)
contact = ContactUs::Contact.new(:email => "Valid@Email.com", :message => "Test")
ContactUs::ContactMailer.should_receive(:contact_email).with(contact).and_return(mail)
contact.save.should eql(true)
Expand Down

0 comments on commit b08a362

Please sign in to comment.