active_fixture 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,19 @@
1
+ require 'test_helper'
2
+
3
+
4
+ class FixtureTest < ActiveSupport::TestCase
5
+
6
+ setup do
7
+ @admin_role = Role.select 1
8
+ end
9
+
10
+ test "role has_many permissions" do
11
+ assert_respond_to @admin_role, :permissions
12
+ end
13
+
14
+ test "role retrieve permissions" do
15
+ assert_equal 3, @admin_role.permissions.size
16
+ assert_kind_of Array, @admin_role.permissions
17
+ end
18
+
19
+ end
@@ -10,8 +10,12 @@ class FixtureTest < ActiveSupport::TestCase
10
10
  end
11
11
  end
12
12
 
13
+ test 'retrive all permissions' do
14
+ assert_equal 3, Permission.all.size
15
+ end
16
+
13
17
  test "retrieve empty array when fixture file doesn't exist" do
14
- assert_equal [], Permission.all
18
+ assert_equal [], EmptyModel.all
15
19
  end
16
20
 
17
21
  test ":select method searchs by id" do
@@ -0,0 +1,17 @@
1
+ require 'test_helper'
2
+
3
+
4
+ class SearchMethodsTest < ActiveSupport::TestCase
5
+
6
+ test "find_by returns array" do
7
+ role = Role.find_by(:id, 1)
8
+
9
+ assert_equal 1, role.size
10
+ end
11
+
12
+ test "find_by returns array with matched" do
13
+ permissions = Permission.find_by(:role_id, 1)
14
+
15
+ assert_equal 3, permissions.size
16
+ end
17
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_fixture
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo RA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-01 00:00:00.000000000 Z
11
+ date: 2014-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -61,12 +61,14 @@ files:
61
61
  - README.rdoc
62
62
  - Rakefile
63
63
  - lib/active_fixture.rb
64
+ - lib/active_fixture/associations.rb
64
65
  - lib/active_fixture/base.rb
65
66
  - lib/active_fixture/errors.rb
66
67
  - lib/active_fixture/loader.rb
67
68
  - lib/active_fixture/search_methods.rb
68
69
  - lib/active_fixture/version.rb
69
70
  - lib/tasks/active_fixture_tasks.rake
71
+ - test/active_fixture_associantion_has_many_test.rb
70
72
  - test/active_fixture_base_test.rb
71
73
  - test/active_fixture_seach_methods_test.rb
72
74
  - test/active_fixture_test.rb
@@ -76,6 +78,7 @@ files:
76
78
  - test/dummy/app/assets/stylesheets/application.css
77
79
  - test/dummy/app/controllers/application_controller.rb
78
80
  - test/dummy/app/helpers/application_helper.rb
81
+ - test/dummy/app/models/empty_model.rb
79
82
  - test/dummy/app/models/permission.rb
80
83
  - test/dummy/app/models/role.rb
81
84
  - test/dummy/app/views/layouts/application.html.erb
@@ -90,6 +93,7 @@ files:
90
93
  - test/dummy/config/environments/development.rb
91
94
  - test/dummy/config/environments/production.rb
92
95
  - test/dummy/config/environments/test.rb
96
+ - test/dummy/config/fixtures/permissions.yml
93
97
  - test/dummy/config/fixtures/roles.yml
94
98
  - test/dummy/config/initializers/backtrace_silencers.rb
95
99
  - test/dummy/config/initializers/filter_parameter_logging.rb
@@ -106,7 +110,9 @@ files:
106
110
  - test/dummy/public/422.html
107
111
  - test/dummy/public/500.html
108
112
  - test/dummy/public/favicon.ico
113
+ - test/integration/associations_test.rb
109
114
  - test/integration/fixture_test.rb
115
+ - test/integration/search_methods_test.rb
110
116
  - test/support/classes.rb
111
117
  - test/test_helper.rb
112
118
  homepage: http://www.imabold.com
@@ -134,6 +140,7 @@ signing_key:
134
140
  specification_version: 4
135
141
  summary: Plugin to load predefined models into Rails application from YAML files
136
142
  test_files:
143
+ - test/active_fixture_associantion_has_many_test.rb
137
144
  - test/active_fixture_base_test.rb
138
145
  - test/active_fixture_seach_methods_test.rb
139
146
  - test/active_fixture_test.rb
@@ -141,6 +148,7 @@ test_files:
141
148
  - test/dummy/app/assets/stylesheets/application.css
142
149
  - test/dummy/app/controllers/application_controller.rb
143
150
  - test/dummy/app/helpers/application_helper.rb
151
+ - test/dummy/app/models/empty_model.rb
144
152
  - test/dummy/app/models/permission.rb
145
153
  - test/dummy/app/models/role.rb
146
154
  - test/dummy/app/views/layouts/application.html.erb
@@ -154,6 +162,7 @@ test_files:
154
162
  - test/dummy/config/environments/development.rb
155
163
  - test/dummy/config/environments/production.rb
156
164
  - test/dummy/config/environments/test.rb
165
+ - test/dummy/config/fixtures/permissions.yml
157
166
  - test/dummy/config/fixtures/roles.yml
158
167
  - test/dummy/config/initializers/backtrace_silencers.rb
159
168
  - test/dummy/config/initializers/filter_parameter_logging.rb
@@ -173,6 +182,8 @@ test_files:
173
182
  - test/dummy/public/favicon.ico
174
183
  - test/dummy/Rakefile
175
184
  - test/dummy/README.rdoc
185
+ - test/integration/associations_test.rb
176
186
  - test/integration/fixture_test.rb
187
+ - test/integration/search_methods_test.rb
177
188
  - test/support/classes.rb
178
189
  - test/test_helper.rb