forked from lailsonbm/awesome_nested_fields
-
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.
Adding initial tests. Probably not enough, but it will do for now.
- Loading branch information
Rodrigo Alves Vieira
committed
Jan 3, 2012
1 parent
a26e3c2
commit 2d113a5
Showing
11 changed files
with
151 additions
and
68 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,4 +1,2 @@ | ||
source :gemcutter | ||
|
||
# Specify your gem's dependencies in awesome_nested_fields.gemspec | ||
gemspec |
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,78 +1,108 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
awesome_nested_fields (0.0.3) | ||
awesome_nested_fields (0.6.0) | ||
rails (>= 3.0.0) | ||
|
||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
abstract (1.0.0) | ||
actionmailer (3.0.4) | ||
actionpack (= 3.0.4) | ||
mail (~> 2.2.15) | ||
actionpack (3.0.4) | ||
activemodel (= 3.0.4) | ||
activesupport (= 3.0.4) | ||
builder (~> 2.1.2) | ||
erubis (~> 2.6.6) | ||
i18n (~> 0.4) | ||
rack (~> 1.2.1) | ||
rack-mount (~> 0.6.13) | ||
rack-test (~> 0.5.7) | ||
tzinfo (~> 0.3.23) | ||
activemodel (3.0.4) | ||
activesupport (= 3.0.4) | ||
builder (~> 2.1.2) | ||
i18n (~> 0.4) | ||
activerecord (3.0.4) | ||
activemodel (= 3.0.4) | ||
activesupport (= 3.0.4) | ||
arel (~> 2.0.2) | ||
tzinfo (~> 0.3.23) | ||
activeresource (3.0.4) | ||
activemodel (= 3.0.4) | ||
activesupport (= 3.0.4) | ||
activesupport (3.0.4) | ||
arel (2.0.8) | ||
builder (2.1.2) | ||
erubis (2.6.6) | ||
abstract (>= 1.0.0) | ||
i18n (0.5.0) | ||
mail (2.2.15) | ||
activesupport (>= 2.3.6) | ||
actionmailer (3.1.3) | ||
actionpack (= 3.1.3) | ||
mail (~> 2.3.0) | ||
actionpack (3.1.3) | ||
activemodel (= 3.1.3) | ||
activesupport (= 3.1.3) | ||
builder (~> 3.0.0) | ||
erubis (~> 2.7.0) | ||
i18n (~> 0.6) | ||
rack (~> 1.3.5) | ||
rack-cache (~> 1.1) | ||
rack-mount (~> 0.8.2) | ||
rack-test (~> 0.6.1) | ||
sprockets (~> 2.0.3) | ||
activemodel (3.1.3) | ||
activesupport (= 3.1.3) | ||
builder (~> 3.0.0) | ||
i18n (~> 0.6) | ||
activerecord (3.1.3) | ||
activemodel (= 3.1.3) | ||
activesupport (= 3.1.3) | ||
arel (~> 2.2.1) | ||
tzinfo (~> 0.3.29) | ||
activeresource (3.1.3) | ||
activemodel (= 3.1.3) | ||
activesupport (= 3.1.3) | ||
activesupport (3.1.3) | ||
multi_json (~> 1.0) | ||
ansi (1.4.1) | ||
arel (2.2.1) | ||
builder (3.0.0) | ||
diff-lcs (1.1.3) | ||
erubis (2.7.0) | ||
hike (1.2.1) | ||
i18n (0.6.0) | ||
json (1.6.4) | ||
mail (2.3.0) | ||
i18n (>= 0.4.0) | ||
mime-types (~> 1.16) | ||
treetop (~> 1.4.8) | ||
mime-types (1.16) | ||
polyglot (0.3.1) | ||
rack (1.2.1) | ||
rack-mount (0.6.13) | ||
mime-types (1.17.2) | ||
multi_json (1.0.4) | ||
polyglot (0.3.3) | ||
rack (1.3.6) | ||
rack-cache (1.1) | ||
rack (>= 0.4) | ||
rack-mount (0.8.3) | ||
rack (>= 1.0.0) | ||
rack-test (0.5.7) | ||
rack-ssl (1.3.2) | ||
rack | ||
rack-test (0.6.1) | ||
rack (>= 1.0) | ||
rails (3.0.4) | ||
actionmailer (= 3.0.4) | ||
actionpack (= 3.0.4) | ||
activerecord (= 3.0.4) | ||
activeresource (= 3.0.4) | ||
activesupport (= 3.0.4) | ||
rails (3.1.3) | ||
actionmailer (= 3.1.3) | ||
actionpack (= 3.1.3) | ||
activerecord (= 3.1.3) | ||
activeresource (= 3.1.3) | ||
activesupport (= 3.1.3) | ||
bundler (~> 1.0) | ||
railties (= 3.0.4) | ||
railties (3.0.4) | ||
actionpack (= 3.0.4) | ||
activesupport (= 3.0.4) | ||
railties (= 3.1.3) | ||
railties (3.1.3) | ||
actionpack (= 3.1.3) | ||
activesupport (= 3.1.3) | ||
rack-ssl (~> 1.3.2) | ||
rake (>= 0.8.7) | ||
thor (~> 0.14.4) | ||
rake (0.8.7) | ||
rdoc (~> 3.4) | ||
thor (~> 0.14.6) | ||
rake (0.9.2.2) | ||
rdoc (3.12) | ||
json (~> 1.4) | ||
rspec (2.7.0) | ||
rspec-core (~> 2.7.0) | ||
rspec-expectations (~> 2.7.0) | ||
rspec-mocks (~> 2.7.0) | ||
rspec-core (2.7.1) | ||
rspec-expectations (2.7.0) | ||
diff-lcs (~> 1.1.2) | ||
rspec-mocks (2.7.0) | ||
sprockets (2.0.3) | ||
hike (~> 1.2) | ||
rack (~> 1.0) | ||
tilt (~> 1.1, != 1.3.0) | ||
thor (0.14.6) | ||
treetop (1.4.9) | ||
tilt (1.3.3) | ||
treetop (1.4.10) | ||
polyglot | ||
polyglot (>= 0.3.1) | ||
tzinfo (0.3.24) | ||
turn (0.8.3) | ||
ansi | ||
tzinfo (0.3.31) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
awesome_nested_fields! | ||
bundler (>= 1.0.0) | ||
rspec (>= 2) | ||
turn (~> 0.8.3) |
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,2 +1,22 @@ | ||
require 'bundler' | ||
Bundler::GemHelper.install_tasks | ||
|
||
# encoding: UTF-8 | ||
|
||
require 'rake/testtask' | ||
require 'rdoc/task' | ||
|
||
task :default => :test | ||
|
||
desc 'Run AwesomeNestedFields unit tests.' | ||
Rake::TestTask.new(:test) do |t| | ||
t.libs << 'lib' | ||
t.libs << 'test' | ||
t.pattern = 'test/*_test.rb' | ||
t.verbose = true | ||
end | ||
|
||
require "rspec/core/rake_task" | ||
RSpec::Core::RakeTask.new(:spec) do |t| | ||
t.rspec_opts = '--backtrace --color' | ||
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 |
---|---|---|
@@ -1,13 +1,7 @@ | ||
module AwesomeNestedFields | ||
class Railtie < ::Rails::Railtie | ||
if Rails.version >= "3.1" | ||
config.before_configuration do | ||
config.action_view.javascript_expansions[:defaults] << 'jquery.nested-fields' | ||
end | ||
else | ||
config.before_configuration do | ||
config.action_view.javascript_expansions[:defaults] << 'jquery.nested-fields.min' | ||
end | ||
config.before_configuration do | ||
config.action_view.javascript_expansions[:defaults] << 'jquery.nested-fields' | ||
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require 'test_helper' | ||
|
||
class AwesomeNestedFieldsTest < ActiveSupport::TestCase | ||
test "it has a version" do | ||
version = AwesomeNestedFields::VERSION | ||
assert_match version, /^\d+\.\d+\.\d+$/ | ||
assert_not_nil version | ||
end | ||
|
||
test "it can escape HTML content" do | ||
escaped_content = AwesomeNestedFields.escape_html_tags("Home > News & Updates") | ||
assert_equal escaped_content, "Home > News & Updates" | ||
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,13 @@ | ||
require "test_helper" | ||
|
||
class InstallGeneratorTest < Rails::Generators::TestCase | ||
tests InstallGenerator | ||
destination File.expand_path("../../tmp", __FILE__) | ||
setup :prepare_destination | ||
|
||
test "it creates all files properly" do | ||
run_generator | ||
assert_file "public/javascripts/jquery.nested-fields.js" if Rails.version < "3.1" | ||
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,9 @@ | ||
$:.unshift 'lib' | ||
|
||
require "rubygems" unless defined?(Gem) | ||
require "rails" | ||
require "awesome_nested_fields" | ||
require "turn" | ||
|
||
require "rails/generators/test_case" | ||
|