serializer 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +23 -0
- data/lib/serializer.rb +4 -4
- data/lib/serializer/version.rb +1 -1
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +3 -0
- data/test/dummy/app/assets/javascripts/main.js +0 -0
- data/test/dummy/app/assets/javascripts/users.js +0 -0
- data/test/dummy/app/assets/stylesheets/application.css +16 -0
- data/test/dummy/app/assets/stylesheets/main.css +4 -0
- data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
- data/test/dummy/app/assets/stylesheets/users.css +4 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/main_controller.rb +10 -0
- data/test/dummy/app/controllers/users_controller.rb +57 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/main_helper.rb +2 -0
- data/test/dummy/app/helpers/users_helper.rb +2 -0
- data/test/dummy/app/models/user.rb +8 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/main/index.html.erb +5 -0
- data/test/dummy/app/views/users/_form.html.erb +36 -0
- data/test/dummy/app/views/users/edit.html.erb +6 -0
- data/test/dummy/app/views/users/index.html.erb +25 -0
- data/test/dummy/app/views/users/new.html.erb +5 -0
- data/test/dummy/app/views/users/show.html.erb +24 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +45 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +17 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +30 -0
- data/test/dummy/config/environments/production.rb +60 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/other.rb +2 -0
- data/test/dummy/config/locales/en.yml +1 -0
- data/test/dummy/config/routes.rb +7 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20110927222742_create_users.rb +11 -0
- data/test/dummy/db/schema.rb +24 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +24 -0
- data/test/dummy/log/test.log +825 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/fixtures/users.yml +11 -0
- data/test/dummy/test/functional/main_controller_test.rb +10 -0
- data/test/dummy/test/functional/users_controller_test.rb +52 -0
- data/test/dummy/test/integration/user_create_test.rb +17 -0
- data/test/dummy/test/integration/user_update_test.rb +17 -0
- data/test/dummy/test/unit/helpers/main_helper_test.rb +4 -0
- data/test/dummy/test/unit/helpers/users_helper_test.rb +4 -0
- data/test/dummy/test/unit/user_test.rb +55 -0
- data/test/serializer_test.rb +7 -0
- data/test/test_helper.rb +8 -0
- metadata +135 -6
- data/Gemfile +0 -3
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class UsersControllerTest < ActionController::TestCase
|
4
|
+
|
5
|
+
fixtures :all
|
6
|
+
|
7
|
+
setup do
|
8
|
+
@user = users(:default)
|
9
|
+
end
|
10
|
+
|
11
|
+
test "should get index" do
|
12
|
+
get :index
|
13
|
+
assert_response :success
|
14
|
+
assert_not_nil assigns(:users)
|
15
|
+
end
|
16
|
+
|
17
|
+
test "should get new" do
|
18
|
+
get :new
|
19
|
+
assert_response :success
|
20
|
+
end
|
21
|
+
|
22
|
+
test "should create user" do
|
23
|
+
assert_difference('User.count') do
|
24
|
+
post :create, :user => @user.attributes
|
25
|
+
end
|
26
|
+
|
27
|
+
assert_redirected_to user_path(assigns(:user))
|
28
|
+
end
|
29
|
+
|
30
|
+
test "should show user" do
|
31
|
+
get :show, :id => @user.id
|
32
|
+
assert_response :success
|
33
|
+
end
|
34
|
+
|
35
|
+
test "should get edit" do
|
36
|
+
get :edit, :id => @user.id
|
37
|
+
assert_response :success
|
38
|
+
end
|
39
|
+
|
40
|
+
test "should update user" do
|
41
|
+
put :update, :id => @user.id, :user => @user.attributes
|
42
|
+
assert_redirected_to user_path(assigns(:user))
|
43
|
+
end
|
44
|
+
|
45
|
+
test "should destroy user" do
|
46
|
+
assert_difference('User.count', -1) do
|
47
|
+
delete :destroy, :id => @user.id
|
48
|
+
end
|
49
|
+
|
50
|
+
assert_redirected_to users_path
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class UserCreateTest < ActionDispatch::IntegrationTest
|
4
|
+
|
5
|
+
fixtures :all
|
6
|
+
|
7
|
+
test "create user" do
|
8
|
+
get new_user_path
|
9
|
+
assert_response :success
|
10
|
+
|
11
|
+
post users_path, { :name => users(:default).name, :email => users(:default).email, :fb_share => "0", :tw_share => "0" }
|
12
|
+
assert_response :redirect
|
13
|
+
|
14
|
+
follow_redirect!
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class UserUpdateTest < ActionDispatch::IntegrationTest
|
4
|
+
|
5
|
+
fixtures :all
|
6
|
+
|
7
|
+
test "update user" do
|
8
|
+
get edit_user_path(users(:default))
|
9
|
+
assert_response :success
|
10
|
+
|
11
|
+
post users_path, { :name => users(:default).name, :email => users(:default).email, :fb_share => "0", :tw_share => "0" }
|
12
|
+
assert_response :redirect
|
13
|
+
|
14
|
+
follow_redirect!
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class UserTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
fixtures :all
|
6
|
+
|
7
|
+
test "defaults" do
|
8
|
+
@user = User.create(:name => "Kevin", :email => "kevin@ksylvest.com")
|
9
|
+
|
10
|
+
assert @user.fb_share?, "should have defaults"
|
11
|
+
assert @user.tw_share?, "should have defaults"
|
12
|
+
end
|
13
|
+
|
14
|
+
test "missing settings" do
|
15
|
+
@user = users(:missing)
|
16
|
+
|
17
|
+
assert @user.fb_share?, "should have defaults"
|
18
|
+
assert @user.tw_share?, "should have defaults"
|
19
|
+
|
20
|
+
@user.fb_share = false
|
21
|
+
@user.tw_share = false
|
22
|
+
|
23
|
+
assert !@user.fb_share?, "should change settings"
|
24
|
+
assert !@user.tw_share?, "should change settings"
|
25
|
+
end
|
26
|
+
|
27
|
+
test "falsify then truthify attributes" do
|
28
|
+
@user = User.create(:name => "Kevin", :email => "kevin@ksylvest.com", :fb_share => false, :tw_share => false)
|
29
|
+
|
30
|
+
assert !@user.fb_share?, "should not have FB sharing if false"
|
31
|
+
assert !@user.tw_share?, "should not have TW sharing if false"
|
32
|
+
|
33
|
+
@user.fb_share = true
|
34
|
+
@user.tw_share = true
|
35
|
+
@user.save
|
36
|
+
|
37
|
+
assert @user.fb_share?, "should have FB sharing if toggled to true"
|
38
|
+
assert @user.tw_share?, "should have TW sharing if toggled to true"
|
39
|
+
end
|
40
|
+
|
41
|
+
test "truthify then falsify attributes" do
|
42
|
+
@user = User.create(:name => "Kevin", :email => "kevin@ksylvest.com", :fb_share => true, :tw_share => true)
|
43
|
+
|
44
|
+
assert @user.fb_share?, "should have FB sharing if true"
|
45
|
+
assert @user.tw_share?, "should have TW sharing if true"
|
46
|
+
|
47
|
+
@user.fb_share = false
|
48
|
+
@user.tw_share = false
|
49
|
+
@user.save
|
50
|
+
|
51
|
+
assert !@user.fb_share?, "should not have FB sharing if toggled to false"
|
52
|
+
assert !@user.tw_share?, "should not have TW sharing if toggled to false"
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,30 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
13
|
-
dependencies:
|
12
|
+
date: 2011-10-23 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: &70335693898320 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>'
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.0.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70335693898320
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: sqlite3
|
27
|
+
requirement: &70335693897600 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70335693897600
|
14
36
|
description: Serializer is a Ruby on Rails tool for adding accessor to serialized
|
15
37
|
attributes with support for types and defaults.
|
16
38
|
email:
|
@@ -25,8 +47,58 @@ files:
|
|
25
47
|
- lib/serializer.rb
|
26
48
|
- README.rdoc
|
27
49
|
- LICENSE
|
28
|
-
- Gemfile
|
29
50
|
- Rakefile
|
51
|
+
- test/dummy/app/assets/javascripts/application.js
|
52
|
+
- test/dummy/app/assets/javascripts/main.js
|
53
|
+
- test/dummy/app/assets/javascripts/users.js
|
54
|
+
- test/dummy/app/assets/stylesheets/application.css
|
55
|
+
- test/dummy/app/assets/stylesheets/main.css
|
56
|
+
- test/dummy/app/assets/stylesheets/scaffold.css
|
57
|
+
- test/dummy/app/assets/stylesheets/users.css
|
58
|
+
- test/dummy/app/controllers/application_controller.rb
|
59
|
+
- test/dummy/app/controllers/main_controller.rb
|
60
|
+
- test/dummy/app/controllers/users_controller.rb
|
61
|
+
- test/dummy/app/helpers/application_helper.rb
|
62
|
+
- test/dummy/app/helpers/main_helper.rb
|
63
|
+
- test/dummy/app/helpers/users_helper.rb
|
64
|
+
- test/dummy/app/models/user.rb
|
65
|
+
- test/dummy/app/views/layouts/application.html.erb
|
66
|
+
- test/dummy/app/views/main/index.html.erb
|
67
|
+
- test/dummy/app/views/users/_form.html.erb
|
68
|
+
- test/dummy/app/views/users/edit.html.erb
|
69
|
+
- test/dummy/app/views/users/index.html.erb
|
70
|
+
- test/dummy/app/views/users/new.html.erb
|
71
|
+
- test/dummy/app/views/users/show.html.erb
|
72
|
+
- test/dummy/config/application.rb
|
73
|
+
- test/dummy/config/boot.rb
|
74
|
+
- test/dummy/config/database.yml
|
75
|
+
- test/dummy/config/environment.rb
|
76
|
+
- test/dummy/config/environments/development.rb
|
77
|
+
- test/dummy/config/environments/production.rb
|
78
|
+
- test/dummy/config/environments/test.rb
|
79
|
+
- test/dummy/config/initializers/other.rb
|
80
|
+
- test/dummy/config/locales/en.yml
|
81
|
+
- test/dummy/config/routes.rb
|
82
|
+
- test/dummy/config.ru
|
83
|
+
- test/dummy/db/development.sqlite3
|
84
|
+
- test/dummy/db/migrate/20110927222742_create_users.rb
|
85
|
+
- test/dummy/db/schema.rb
|
86
|
+
- test/dummy/db/test.sqlite3
|
87
|
+
- test/dummy/log/development.log
|
88
|
+
- test/dummy/log/test.log
|
89
|
+
- test/dummy/public/favicon.ico
|
90
|
+
- test/dummy/Rakefile
|
91
|
+
- test/dummy/script/rails
|
92
|
+
- test/dummy/test/fixtures/users.yml
|
93
|
+
- test/dummy/test/functional/main_controller_test.rb
|
94
|
+
- test/dummy/test/functional/users_controller_test.rb
|
95
|
+
- test/dummy/test/integration/user_create_test.rb
|
96
|
+
- test/dummy/test/integration/user_update_test.rb
|
97
|
+
- test/dummy/test/unit/helpers/main_helper_test.rb
|
98
|
+
- test/dummy/test/unit/helpers/users_helper_test.rb
|
99
|
+
- test/dummy/test/unit/user_test.rb
|
100
|
+
- test/serializer_test.rb
|
101
|
+
- test/test_helper.rb
|
30
102
|
homepage: http://github.com/ksylvest/serializer
|
31
103
|
licenses: []
|
32
104
|
post_install_message:
|
@@ -39,16 +111,73 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
39
111
|
- - ! '>='
|
40
112
|
- !ruby/object:Gem::Version
|
41
113
|
version: '0'
|
114
|
+
segments:
|
115
|
+
- 0
|
116
|
+
hash: -4604038091758846028
|
42
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
118
|
none: false
|
44
119
|
requirements:
|
45
120
|
- - ! '>='
|
46
121
|
- !ruby/object:Gem::Version
|
47
122
|
version: '0'
|
123
|
+
segments:
|
124
|
+
- 0
|
125
|
+
hash: -4604038091758846028
|
48
126
|
requirements: []
|
49
127
|
rubyforge_project:
|
50
|
-
rubygems_version: 1.8.
|
128
|
+
rubygems_version: 1.8.11
|
51
129
|
signing_key:
|
52
130
|
specification_version: 3
|
53
131
|
summary: A serialized attribute accessor gem with support for types and defaults
|
54
|
-
test_files:
|
132
|
+
test_files:
|
133
|
+
- test/dummy/app/assets/javascripts/application.js
|
134
|
+
- test/dummy/app/assets/javascripts/main.js
|
135
|
+
- test/dummy/app/assets/javascripts/users.js
|
136
|
+
- test/dummy/app/assets/stylesheets/application.css
|
137
|
+
- test/dummy/app/assets/stylesheets/main.css
|
138
|
+
- test/dummy/app/assets/stylesheets/scaffold.css
|
139
|
+
- test/dummy/app/assets/stylesheets/users.css
|
140
|
+
- test/dummy/app/controllers/application_controller.rb
|
141
|
+
- test/dummy/app/controllers/main_controller.rb
|
142
|
+
- test/dummy/app/controllers/users_controller.rb
|
143
|
+
- test/dummy/app/helpers/application_helper.rb
|
144
|
+
- test/dummy/app/helpers/main_helper.rb
|
145
|
+
- test/dummy/app/helpers/users_helper.rb
|
146
|
+
- test/dummy/app/models/user.rb
|
147
|
+
- test/dummy/app/views/layouts/application.html.erb
|
148
|
+
- test/dummy/app/views/main/index.html.erb
|
149
|
+
- test/dummy/app/views/users/_form.html.erb
|
150
|
+
- test/dummy/app/views/users/edit.html.erb
|
151
|
+
- test/dummy/app/views/users/index.html.erb
|
152
|
+
- test/dummy/app/views/users/new.html.erb
|
153
|
+
- test/dummy/app/views/users/show.html.erb
|
154
|
+
- test/dummy/config/application.rb
|
155
|
+
- test/dummy/config/boot.rb
|
156
|
+
- test/dummy/config/database.yml
|
157
|
+
- test/dummy/config/environment.rb
|
158
|
+
- test/dummy/config/environments/development.rb
|
159
|
+
- test/dummy/config/environments/production.rb
|
160
|
+
- test/dummy/config/environments/test.rb
|
161
|
+
- test/dummy/config/initializers/other.rb
|
162
|
+
- test/dummy/config/locales/en.yml
|
163
|
+
- test/dummy/config/routes.rb
|
164
|
+
- test/dummy/config.ru
|
165
|
+
- test/dummy/db/development.sqlite3
|
166
|
+
- test/dummy/db/migrate/20110927222742_create_users.rb
|
167
|
+
- test/dummy/db/schema.rb
|
168
|
+
- test/dummy/db/test.sqlite3
|
169
|
+
- test/dummy/log/development.log
|
170
|
+
- test/dummy/log/test.log
|
171
|
+
- test/dummy/public/favicon.ico
|
172
|
+
- test/dummy/Rakefile
|
173
|
+
- test/dummy/script/rails
|
174
|
+
- test/dummy/test/fixtures/users.yml
|
175
|
+
- test/dummy/test/functional/main_controller_test.rb
|
176
|
+
- test/dummy/test/functional/users_controller_test.rb
|
177
|
+
- test/dummy/test/integration/user_create_test.rb
|
178
|
+
- test/dummy/test/integration/user_update_test.rb
|
179
|
+
- test/dummy/test/unit/helpers/main_helper_test.rb
|
180
|
+
- test/dummy/test/unit/helpers/users_helper_test.rb
|
181
|
+
- test/dummy/test/unit/user_test.rb
|
182
|
+
- test/serializer_test.rb
|
183
|
+
- test/test_helper.rb
|
data/Gemfile
DELETED