forked from spree-contrib/spree_mail_settings
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
52 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
module Spree | ||
AppConfiguration.class_eval do | ||
# Default mail headers settings | ||
preference :enable_mail_delivery, :boolean, :default => false | ||
preference :mail_bcc, :string, :default => '[email protected]' | ||
preference :intercept_email, :string, :default => nil | ||
preference :enable_mail_delivery, :boolean, default: false | ||
preference :mail_bcc, :string, default: '[email protected]' | ||
preference :intercept_email, :string, default: nil | ||
|
||
# Default smtp settings | ||
preference :mail_host, :string, :default => 'localhost' | ||
preference :mail_domain, :string, :default => 'localhost' | ||
preference :mail_port, :integer, :default => 25 | ||
preference :secure_connection_type, :string, :default => Core::MailSettings::SECURE_CONNECTION_TYPES[0] | ||
preference :mail_auth_type, :string, :default => Core::MailSettings::MAIL_AUTH[0] | ||
preference :mail_host, :string, default: 'localhost' | ||
preference :mail_domain, :string, default: 'localhost' | ||
preference :mail_port, :integer, default: 25 | ||
preference :secure_connection_type, :string, default: Core::MailSettings::SECURE_CONNECTION_TYPES[0] | ||
preference :mail_auth_type, :string, default: Core::MailSettings::MAIL_AUTH[0] | ||
preference :smtp_username, :string | ||
preference :smtp_password, :string | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
Deface::Override.new( | ||
:virtual_path => "spree/admin/shared/_configuration_menu", | ||
:name => "mail_settings_admin_configurations_menu", | ||
:insert_bottom => "[data-hook='admin_configurations_sidebar_menu']", | ||
:text => "<%= configurations_sidebar_menu_item Spree.t(:mail_method_settings), edit_admin_mail_method_url %>", | ||
:disabled => false) | ||
virtual_path: "spree/admin/shared/_configuration_menu", | ||
name: "mail_settings_admin_configurations_menu", | ||
insert_bottom: "[data-hook='admin_configurations_sidebar_menu']", | ||
text: "<%= configurations_sidebar_menu_item Spree.t(:mail_method_settings), edit_admin_mail_method_url %>", | ||
disabled: false | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Spree::Core::Engine.routes.append do | ||
namespace :admin do | ||
resource :mail_method, :only => [:edit, :update] do | ||
post :testmail, :on => :collection | ||
resource :mail_method, only: [:edit, :update] do | ||
post :testmail, on: :collection | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,14 @@ | |
|
||
context "#update" do | ||
it "should reinitialize the mail settings" do | ||
spree_put :update, { :enable_mail_delivery => "1", :mails_from => "[email protected]" } | ||
spree_put :update, { enable_mail_delivery: "1", mails_from: "[email protected]" } | ||
response.should be_redirect | ||
end | ||
end | ||
|
||
it "can trigger testmail" do | ||
user = create(:user, email: '[email protected]') | ||
controller.stub(:try_spree_current_user => user) | ||
controller.stub(try_spree_current_user: user) | ||
Spree::Config[:enable_mail_delivery] = "1" | ||
|
||
expect { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
end | ||
|
||
it "should be able to edit mail method settings" do | ||
fill_in "mail_bcc", :with => "[email protected]" | ||
fill_in "mail_bcc", with: "[email protected]" | ||
click_button "Update" | ||
page.should have_content("successfully updated!") | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# We'll use the OrderMailer as a quick and easy way to test. IF it works here | ||
# it works for all email (in theory.) | ||
describe Spree::OrderMailer do | ||
let(:order) { Spree::Order.new(:email => "[email protected]") } | ||
let(:order) { Spree::Order.new(email: "[email protected]") } | ||
let(:message) { Spree::OrderMailer.confirm_email(order) } | ||
|
||
before(:all) do | ||
|