-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from n-rodriguez/feat_add_options
Add an optional hash to not include <script> tag
- Loading branch information
Showing
8 changed files
with
86 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
*.swp | ||
**/*.swp | ||
**/*.log | ||
*.gem | ||
Gemfile.lock | ||
.bundle | ||
|
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,8 +1,10 @@ | ||
rvm: | ||
- 2.1.2 | ||
- 2.1.7 | ||
- 2.2.1 | ||
- 2.2.2 | ||
- 2.2.3 | ||
- rbx-2 | ||
bundler_args: --without development | ||
before_script: | ||
- "export DISPLAY=:99.0" | ||
- "sh -e /etc/init.d/xvfb start" | ||
sudo: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
source 'http://rubygems.org' | ||
gemspec | ||
|
||
gem 'rake' | ||
gem 'faye-redis' | ||
gem 'guard' | ||
gem 'guard-coffeescript' | ||
gem 'jasmine', '>= 2.0.0' | ||
gem 'rspec', '>= 3.0.0' | ||
gem 'rspec-mocks', '>= 3.0.0' | ||
gem 'webmock' | ||
gem 'coveralls', require: false | ||
|
||
group :development, :test do | ||
gem 'rake' | ||
gem 'guard' | ||
gem 'guard-coffeescript' | ||
gem 'jasmine', '>= 2.0.0' | ||
gem 'rspec', '>= 3.0.0' | ||
gem 'rspec-mocks', '>= 3.0.0' | ||
gem 'webmock' | ||
gem 'coveralls', require: false | ||
gem 'rails' | ||
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require 'spec_helper' | ||
require 'danthes/view_helpers' | ||
|
||
module Danthes | ||
describe ViewHelpers do | ||
|
||
let(:klass) do | ||
Class.new do | ||
include ActionView::Helpers::TagHelper | ||
include ActionView::Context | ||
include ViewHelpers | ||
end | ||
end | ||
|
||
describe '#subscribe_to' do | ||
it "generates javascript tag by default" do | ||
expect(klass.new.subscribe_to('hello')).to match /\A<script.*<\/script>\z/ | ||
end | ||
|
||
it "removes javascript tag when *include_js_tag* is set to false" do | ||
expect(klass.new.subscribe_to('hello', include_js_tag: false)).to match /\Aif \(typeof Danthes \!= 'undefined'\) { Danthes.sign\(.*\) }\z/ | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ENV['RAILS_ENV'] ||= 'test' | ||
|
||
require 'action_controller/railtie' | ||
require 'danthes' | ||
|
||
module RailsApp | ||
class Application < Rails::Application | ||
config.active_support.deprecation = :log | ||
config.cache_classes = true | ||
config.eager_load = false | ||
config.root = __dir__ | ||
config.secret_token = 'x'*100 | ||
config.session_store :cookie_store, key: '_myapp_session' | ||
end | ||
end | ||
|
||
Rails.backtrace_cleaner.remove_silencers! | ||
RailsApp::Application.initialize! |
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