odania_core 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :user_role, :class => 'Odania::UserRole' do
5
+ user
6
+ role 1
7
+ end
8
+ end
@@ -4,5 +4,9 @@ FactoryGirl.define do
4
4
  factory :user, :class => 'Odania::User' do
5
5
  sequence(:name) { |n| "User#{n}" }
6
6
  sequence(:email) { |n| "mail#{n}@example.com" }
7
+
8
+ after(:create) do |user, evaluator|
9
+ create_list(:user_role, 1, user: user)
10
+ end
7
11
  end
8
12
  end
@@ -6,6 +6,12 @@ module OdaniaTestMock
6
6
 
7
7
  def self.current_user
8
8
  @@mock_current_user ||= Odania::User.find_or_create_by(name: 'Admin', email: 'mail@example.com')
9
+
10
+ if @@mock_current_user.roles.count == 0
11
+ @@mock_current_user.roles.create(role: Odania::UserRole.roles[:admin])
12
+ end
13
+
14
+ return @@mock_current_user
9
15
  end
10
16
 
11
17
  mattr_accessor :user_authenticated
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odania_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Petersen
@@ -264,6 +264,7 @@ files:
264
264
  - app/models/odania/tag_xref.rb
265
265
  - app/models/odania/target_type.rb
266
266
  - app/models/odania/user.rb
267
+ - app/models/odania/user_role.rb
267
268
  - app/views/admin/dashboard/index.html.erb
268
269
  - app/views/admin/odania/contents/_choose_content.html.erb
269
270
  - app/views/admin/odania/contents/_choose_content_list.html.erb
@@ -330,9 +331,8 @@ files:
330
331
  - db/migrate/20140313225265_create_user.rb
331
332
  - db/migrate/20140323201042_create_odania_tags.rb
332
333
  - db/migrate/20140323201249_create_odania_tag_xrefs.rb
333
- - db/migrate/20140413151353_add_current_menu_item_to_content.rb
334
- - db/migrate/20140425164032_remove_menu_item_from_content.rb
335
- - db/migrate/20140425190306_add_language_to_tag.rb
334
+ - db/migrate/20140425195051_create_odania_user_roles.rb
335
+ - db/migrate/20140425202800_add_site_id_to_user.rb
336
336
  - db/seeds.rb
337
337
  - lib/odania.rb
338
338
  - lib/odania/admin.rb
@@ -7819,13 +7819,13 @@ files:
7819
7819
  - test/dummy/tmp/cache/assets/test/sprockets/ffb4e3c08cd390e6c34ecb8986a80042
7820
7820
  - test/dummy/tmp/cache/assets/test/sprockets/ffb88b74367cc52503ed6c38dcc55576
7821
7821
  - test/dummy/tmp/cache/assets/test/sprockets/ffe28ecf6034094189c88aa8d34d995c
7822
- - test/dummy/tmp/pids/server.pid
7823
7822
  - test/factories/contents.rb
7824
7823
  - test/factories/languages.rb
7825
7824
  - test/factories/menu_items.rb
7826
7825
  - test/factories/menus.rb
7827
7826
  - test/factories/odania_tag_xrefs.rb
7828
7827
  - test/factories/odania_tags.rb
7828
+ - test/factories/odania_user_roles.rb
7829
7829
  - test/factories/odania_users.rb
7830
7830
  - test/factories/sites.rb
7831
7831
  - test/integration/helper_test.rb
@@ -15319,7 +15319,6 @@ test_files:
15319
15319
  - test/dummy/tmp/cache/assets/test/sprockets/b6a2fa0f3219d0551f8eddcb3fde524d
15320
15320
  - test/dummy/tmp/cache/assets/test/sprockets/5a87c17b3c5e6209890da9d8fea08911
15321
15321
  - test/dummy/tmp/cache/24C/7A1/views%2Flvh.me%3A3000%2Fde%2Fm1%2Ff188e6e90cf2009ed49591a40fdd2329
15322
- - test/dummy/tmp/pids/server.pid
15323
15322
  - test/dummy/db/test.sqlite3
15324
15323
  - test/dummy/db/production.sqlite3
15325
15324
  - test/dummy/db/schema.rb
@@ -15343,6 +15342,7 @@ test_files:
15343
15342
  - test/integration/helper_test.rb
15344
15343
  - test/integration/menu_route_test.rb
15345
15344
  - test/factories/contents.rb
15345
+ - test/factories/odania_user_roles.rb
15346
15346
  - test/factories/odania_users.rb
15347
15347
  - test/factories/languages.rb
15348
15348
  - test/factories/odania_tag_xrefs.rb
@@ -1,5 +0,0 @@
1
- class AddCurrentMenuItemToContent < ActiveRecord::Migration
2
- def change
3
- add_column :odania_contents, :current_menu_item_id, :integer
4
- end
5
- end
@@ -1,6 +0,0 @@
1
- class RemoveMenuItemFromContent < ActiveRecord::Migration
2
- def change
3
- remove_column :odania_contents, :menu_item_id
4
- remove_column :odania_contents, :current_menu_item_id
5
- end
6
- end
@@ -1,5 +0,0 @@
1
- class AddLanguageToTag < ActiveRecord::Migration
2
- def change
3
- add_column :odania_tags, :language_id, :integer
4
- end
5
- end
@@ -1 +0,0 @@
1
- 20209