adminpanel 1.2.9 → 1.2.10
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/adminpanel.gemspec +1 -0
- data/app/controllers/adminpanel/analytics_controller.rb +1 -1
- data/app/controllers/adminpanel/application_controller.rb +6 -6
- data/app/controllers/adminpanel/categories_controller.rb +17 -8
- data/app/controllers/adminpanel/galleries_controller.rb +2 -0
- data/app/controllers/adminpanel/sections_controller.rb +2 -0
- data/app/controllers/adminpanel/sessions_controller.rb +2 -2
- data/app/controllers/adminpanel/users_controller.rb +2 -0
- data/app/helpers/adminpanel/custom_form_builder.rb +24 -0
- data/app/helpers/adminpanel/rest_actions_helper.rb +26 -9
- data/app/helpers/adminpanel/shared_pages_helper.rb +2 -1
- data/app/models/adminpanel/group.rb +6 -0
- data/app/models/adminpanel/user.rb +48 -5
- data/app/views/adminpanel/categories/_categories_table.html.erb +3 -2
- data/app/views/adminpanel/categories/_category_form.html.erb +4 -4
- data/app/views/adminpanel/categories/create.js.erb +2 -1
- data/app/views/adminpanel/categories/index.html.erb +1 -1
- data/app/views/adminpanel/categories/new.js.erb +2 -1
- data/app/views/layouts/_side_menu.html.erb +20 -18
- data/app/views/layouts/_top_bar.html.erb +1 -1
- data/app/views/shared/_form_fields.html.erb +57 -5
- data/app/views/shared/_modal.html.erb +8 -0
- data/app/views/shared/_remote_form_fields.html.erb +12 -0
- data/app/views/shared/create_belongs_to.js.erb +5 -0
- data/app/views/shared/create_has_many.js.erb +5 -0
- data/app/views/shared/edit.html.erb +1 -0
- data/app/views/shared/new.html.erb +15 -4
- data/app/views/shared/new.js.erb +2 -0
- data/config/locales/es.yml +5 -3
- data/lib/adminpanel.rb +1 -0
- data/lib/adminpanel/active_record/adminpanel_extension.rb +0 -4
- data/lib/adminpanel/version.rb +1 -1
- data/lib/generators/adminpanel/initialize/initialize_generator.rb +11 -0
- data/lib/generators/adminpanel/initialize/templates/ability.rb +31 -0
- data/lib/generators/adminpanel/initialize/templates/adminpanel_setup.rb +7 -7
- data/lib/generators/adminpanel/initialize/templates/create_adminpanel_tables.rb +9 -1
- data/lib/tasks/adminpanel/adminpanel.rake +2 -1
- data/spec/dummy/app/models/ability.rb +31 -0
- data/spec/dummy/app/models/adminpanel/category.rb +4 -1
- data/spec/features/authentication_pages_spec.rb +6 -5
- data/spec/features/galleries_pages_spec.rb +3 -1
- data/spec/features/section_pages_spec.rb +2 -1
- data/spec/features/shared_pages_spec.rb +66 -22
- data/spec/generators/gallery_generator_spec.rb +3 -3
- data/spec/generators/resource_generator_spec.rb +3 -3
- data/spec/models/gallery_spec.rb +3 -1
- data/spec/models/section_spec.rb +12 -11
- data/spec/models/user_spec.rb +6 -2
- data/spec/spec_helper.rb +5 -2
- data/spec/support/define_factory_models.rb +6 -0
- data/spec/support/helper_methods.rb +2 -1
- data/spec/support/test_database.rb +7 -0
- data/spec/tasks/adminpanel_rake_spec.rb +1 -0
- metadata +53 -32
- data/spec/dummy/app/controllers/adminpanel/categories_controller.rb +0 -4
- data/spec/models/product_spec.rb +0 -39
data/spec/models/product_spec.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Adminpanel::Product do
|
4
|
-
# before do
|
5
|
-
# @product = Adminpanel::Product.new(
|
6
|
-
# :description => "Test description for product",
|
7
|
-
# :name => "product name",
|
8
|
-
# :brief => "short description"
|
9
|
-
# )
|
10
|
-
# end
|
11
|
-
|
12
|
-
# subject { @product }
|
13
|
-
|
14
|
-
# it { should respond_to(:name) }
|
15
|
-
# it { should respond_to(:description) }
|
16
|
-
# it { should respond_to(:brief) }
|
17
|
-
|
18
|
-
# end
|
19
|
-
|
20
|
-
# describe "when no name present" do
|
21
|
-
# before {@product.name = " "}
|
22
|
-
# it {should_not be_valid}
|
23
|
-
# end
|
24
|
-
|
25
|
-
# describe "when no description present" do
|
26
|
-
# before {@product.description = " "}
|
27
|
-
# it {should_not be_valid}
|
28
|
-
# end
|
29
|
-
|
30
|
-
# it {should_not be_valid}
|
31
|
-
# end
|
32
|
-
|
33
|
-
# describe "when no brief is present" do
|
34
|
-
# before {@product.brief = " "}
|
35
|
-
# it {should_not be_valid}
|
36
|
-
# end
|
37
|
-
|
38
|
-
|
39
|
-
end
|