Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/textris/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ def call_action
end

def render_content
renderer = ActionController::Base.renderer.new

renderer.render(
ApplicationController.render(
template: template_name,
layout: false,
formats: [:text],
Expand Down
2 changes: 1 addition & 1 deletion lib/textris/delivery/mail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_template_interpolation(key, variables)
def get_rails_variable(var)
case var
when 'app'
Rails.application.class.module_parent_name
Rails.application.class.try(:module_parent_name)
when 'env'
Rails.env
end
Expand Down
2 changes: 1 addition & 1 deletion lib/textris/delivery/twilio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def deliver(to)
options[:media_url] = message.media_urls
end

client.messages.create(options)
client.messages.create(**options)
end

private
Expand Down
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require 'active_support/testing/time_helpers'

CodeClimate::TestReporter.configuration.logger = Logger.new("/dev/null")
Sidekiq.strict_args!(false)

if Scrutinizer::Ocular.should_run? ||
CodeClimate::TestReporter.run? ||
Expand All @@ -33,6 +34,10 @@
require_relative '../lib/textris'

RSpec.configure do |config|
config.before(:suite) do
ApplicationController = ActionController::Base.renderer.new
end

config.include ActiveSupport::Testing::TimeHelpers

config.expect_with :rspec do |expectations|
Expand Down
5 changes: 3 additions & 2 deletions spec/textris/delivery/mail_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ class Application < OpenStruct; end

Rails = OpenStruct.new(
:application => MyAppName::Application.new(
:config => OpenStruct.new
:config => OpenStruct.new,
class: OpenStruct.new(module_parent_name: 'MyAppName')
),
:env => 'test'
:env => 'test',
)

class FakeMail
Expand Down