nostalgic 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -24
- data/Rakefile +3 -8
- data/app/assets/config/nostalgic_manifest.js +2 -0
- data/app/assets/javascripts/nostalgic/application.js +3 -1
- data/app/assets/stylesheets/nostalgic/application.css +3 -3
- data/app/jobs/nostalgic/application_job.rb +4 -0
- data/app/mailers/nostalgic/application_mailer.rb +6 -0
- data/app/models/nostalgic/application_record.rb +5 -0
- data/app/views/layouts/nostalgic/application.html.erb +3 -1
- data/lib/nostalgic.rb +3 -3
- data/lib/nostalgic/nostalgic_attr.rb +48 -26
- data/lib/nostalgic/railtie.rb +3 -5
- data/lib/nostalgic/version.rb +1 -1
- metadata +27 -126
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/assets/stylesheets/application.css +0 -15
- data/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/models/company.rb +0 -3
- data/test/dummy/app/models/user.rb +0 -4
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/bin/bundle +0 -3
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/bin/setup +0 -29
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -23
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -41
- data/test/dummy/config/environments/production.rb +0 -79
- data/test/dummy/config/environments/test.rb +0 -42
- data/test/dummy/config/initializers/assets.rb +0 -11
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -23
- data/test/dummy/config/routes.rb +0 -4
- data/test/dummy/config/secrets.yml +0 -22
- data/test/dummy/db/migrate/20160807103323_create_users.rb +0 -9
- data/test/dummy/db/migrate/20161217105723_create_companies.rb +0 -8
- data/test/dummy/db/migrate/20161217105921_add_column_company_id_on_users.rb +0 -5
- data/test/dummy/db/schema.rb +0 -40
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +0 -162
- data/test/dummy/public/404.html +0 -67
- data/test/dummy/public/422.html +0 -67
- data/test/dummy/public/500.html +0 -66
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/models/company_test.rb +0 -5
- data/test/dummy/test/models/user_test.rb +0 -60
- data/test/fixtures/companies.yml +0 -7
- data/test/fixtures/nostalgic/attrs.yml +0 -28
- data/test/fixtures/users.yml +0 -5
- data/test/integration/navigation_test.rb +0 -8
- data/test/models/nostalgic/attr_test.rb +0 -11
- data/test/nostalgic_test.rb +0 -11
- data/test/test_helper.rb +0 -21
File without changes
|
@@ -1,60 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class UserTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
def test_belongs_to
|
6
|
-
assert @user = User.first
|
7
|
-
assert_equal 1, @user.company_id
|
8
|
-
|
9
|
-
today = Date.today
|
10
|
-
assert_equal 1, @user.company_on(today).id
|
11
|
-
|
12
|
-
@user.company_id = Company.second.id
|
13
|
-
@user.company_id_effective_at = today + 1.day
|
14
|
-
assert @user.save
|
15
|
-
|
16
|
-
@user.reload
|
17
|
-
assert_equal 1, @user.company.id
|
18
|
-
assert_equal 1, @user.company_on(nil).id
|
19
|
-
assert_equal 1, @user.company_on(today - 1.day).id
|
20
|
-
assert_equal 1, @user.company_on(today).id
|
21
|
-
assert_equal 2, @user.company_on(today + 1.day).id
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_tel
|
25
|
-
assert @user = User.first
|
26
|
-
assert_equal '222-123-4567', @user.tel
|
27
|
-
|
28
|
-
assert_equal '222-123-4567', @user.tel_at(nil)
|
29
|
-
assert_equal '111-123-4567', @user.tel_at(Date.today - 1.day)
|
30
|
-
assert_equal '222-123-4567', @user.tel_at(Date.today)
|
31
|
-
assert_equal '333-123-4567', @user.tel_at(Date.today + 1.day)
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_save_tel
|
35
|
-
today = Date.today
|
36
|
-
assert @user = User.first
|
37
|
-
assert_not_equal '444-123-4567', @user.tel
|
38
|
-
assert_not_equal '444-123-4567', @user.tel_at(today)
|
39
|
-
|
40
|
-
@user.tel = '444-123-4567'
|
41
|
-
@user.tel_effective_at = today
|
42
|
-
assert @user.save
|
43
|
-
assert_equal '444-123-4567', @user.tel
|
44
|
-
assert_equal '444-123-4567', @user.tel_at(today)
|
45
|
-
|
46
|
-
@user.tel = '555-123-4567'
|
47
|
-
@user.tel_effective_at = today + 2.days
|
48
|
-
assert @user.save
|
49
|
-
assert_equal '555-123-4567', @user.tel
|
50
|
-
assert_equal '444-123-4567', @user.tel_at(today)
|
51
|
-
assert_equal '333-123-4567', @user.tel_at(today + 1.day)
|
52
|
-
assert_equal '555-123-4567', @user.tel_at(today + 2.day)
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_tels
|
56
|
-
assert @user = User.first
|
57
|
-
assert @user.respond_to?(:tels)
|
58
|
-
assert_equal 3, @user.tels.size
|
59
|
-
end
|
60
|
-
end
|
data/test/fixtures/companies.yml
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
1:
|
2
|
-
id: 1
|
3
|
-
model_type: User
|
4
|
-
model_id: 1
|
5
|
-
name: tel
|
6
|
-
value: '111-123-4567'
|
7
|
-
effective_at: <%= Date.today - 1.month %>
|
8
|
-
2:
|
9
|
-
id: 2
|
10
|
-
model_type: User
|
11
|
-
model_id: 1
|
12
|
-
name: tel
|
13
|
-
value: '222-123-4567'
|
14
|
-
effective_at: <%= Date.today %>
|
15
|
-
3:
|
16
|
-
id: 3
|
17
|
-
model_type: User
|
18
|
-
model_id: 1
|
19
|
-
name: tel
|
20
|
-
value: '333-123-4567'
|
21
|
-
effective_at: <%= Date.today + 1.day %>
|
22
|
-
4:
|
23
|
-
id: 4
|
24
|
-
model_type: User
|
25
|
-
model_id: 1
|
26
|
-
name: company_id
|
27
|
-
value: 1
|
28
|
-
effective_at: <%= Date.today - 1.day %>
|
data/test/fixtures/users.yml
DELETED
data/test/nostalgic_test.rb
DELETED
data/test/test_helper.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# Configure Rails Environment
|
2
|
-
ENV["RAILS_ENV"] = "test"
|
3
|
-
|
4
|
-
require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
|
5
|
-
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
|
6
|
-
ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
|
7
|
-
require "rails/test_help"
|
8
|
-
|
9
|
-
# Filter out Minitest backtrace while allowing backtrace from other libraries
|
10
|
-
# to be shown.
|
11
|
-
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
|
12
|
-
|
13
|
-
# Load support files
|
14
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
15
|
-
|
16
|
-
# Load fixtures from the engine
|
17
|
-
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
|
18
|
-
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
19
|
-
ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
|
20
|
-
ActiveSupport::TestCase.fixtures :all
|
21
|
-
end
|