radiant-page_list_view-extension 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,65 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{radiant-page_list_view-extension}
8
+ s.version = "0.9.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Andrew vonderLuft", "Sean Cribbs"]
12
+ s.date = %q{2011-04-20}
13
+ s.description = %q{Enables viewing site pages in a list sortable by attibute.}
14
+ s.email = %q{avonderluft@avlux.net}
15
+ s.extra_rdoc_files = [
16
+ "README.textile"
17
+ ]
18
+ s.files = [
19
+ ".gitmodules",
20
+ "HELP.textile",
21
+ "README.textile",
22
+ "Rakefile",
23
+ "app/helpers/admin/list_view_helper.rb",
24
+ "app/views/admin/pages/_page.html.haml",
25
+ "app/views/admin/pages/page_list_view.html.haml",
26
+ "config/routes.rb",
27
+ "lib/page_list_view/admin_page_controller_extensions.rb",
28
+ "lib/page_list_view/page_extensions.rb",
29
+ "lib/tasks/page_list_view_extension_tasks.rake",
30
+ "page_list_view_extension.rb",
31
+ "pkg/radiant-page_list_view-extension-0.9.1.gem",
32
+ "public/images/admin/application_cascade.png",
33
+ "public/images/admin/application_side_tree.png",
34
+ "public/images/admin/application_view_detail.png",
35
+ "public/images/admin/application_view_list.png",
36
+ "public/javascripts/admin/tablekit.js",
37
+ "radiant-page_list_view-extension.gemspec",
38
+ "spec/controllers/admin_page_controller_extensions_spec.rb",
39
+ "spec/models/page_extensions_spec.rb",
40
+ "spec/spec.opts",
41
+ "spec/spec_helper.rb"
42
+ ]
43
+ s.homepage = %q{https://github.com/avonderluft/radiant-page_list_view-extension}
44
+ s.require_paths = ["lib"]
45
+ s.rubygems_version = %q{1.5.2}
46
+ s.summary = %q{Page List View Extension for Radiant CMS}
47
+ s.test_files = [
48
+ "spec/controllers/admin_page_controller_extensions_spec.rb",
49
+ "spec/models/page_extensions_spec.rb",
50
+ "spec/spec_helper.rb"
51
+ ]
52
+
53
+ if s.respond_to? :specification_version then
54
+ s.specification_version = 3
55
+
56
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
57
+ s.add_runtime_dependency(%q<radiant>, [">= 0.9.1"])
58
+ else
59
+ s.add_dependency(%q<radiant>, [">= 0.9.1"])
60
+ end
61
+ else
62
+ s.add_dependency(%q<radiant>, [">= 0.9.1"])
63
+ end
64
+ end
65
+
@@ -0,0 +1,63 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ Admin::PagesController.module_eval { def rescue_action(e); raise e; end }
4
+
5
+ describe Admin::PagesController, 'list view' do
6
+ dataset :users_and_pages
7
+ before :each do
8
+ login_as :existing
9
+ end
10
+
11
+ describe "alias chain" do
12
+ it "should be set up" do
13
+ controller.should respond_to(:index_without_page_list_view)
14
+ controller.should respond_to(:index_with_page_list_view)
15
+ controller.should respond_to(:index)
16
+ end
17
+ end
18
+
19
+ describe "GET to /index" do
20
+ it "should display the tree view by default" do
21
+ get :index
22
+ assigns[:homepage].should_not be_nil
23
+ response.should be_success
24
+ response.should render_template("index")
25
+ end
26
+
27
+ %w(list).each do |view|
28
+ it "should display the #{view} view" do
29
+ get :index, :view => view
30
+ assigns[:pages].should_not be_blank
31
+ response.should be_success
32
+ response.should render_template('page_list_view')
33
+ end
34
+ end
35
+ end
36
+
37
+ describe "paginatation" do
38
+ it "should be paginated" do
39
+ Admin::PagesController.paginated.should be_true
40
+ controller.paginated?.should be_true
41
+ end
42
+
43
+ it "should have pagination defaults" do
44
+ controller.pagination_parameters.should == {:page => 1, :per_page => 50}
45
+ controller.will_paginate_options.should == {:param_name => :p}
46
+ end
47
+
48
+ it "should override defaults with pagination settings from config" do
49
+ Radiant::Config['admin.pagination.per_page'] = 23
50
+ controller.pagination_parameters.should == {:page => 1, :per_page => 23}
51
+ end
52
+
53
+ it "should override configuration with pagination settings from paginate_models" do
54
+ Admin::PagesController.send :paginate_models, {:per_page => 5, :inner_window => 12}
55
+ controller.pagination_parameters.should == {:page => 1, :per_page => 5}
56
+ controller.will_paginate_options.should == {:inner_window => 12, :param_name => :p}
57
+ end
58
+ end
59
+
60
+ after :each do
61
+ logout
62
+ end
63
+ end
@@ -0,0 +1,25 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Page, "with list view extensions" do
4
+ dataset :users_and_pages
5
+ it "should display the user who last updated the page" do
6
+ pages(:home).updated_by_name.should == users(:admin).name
7
+ end
8
+
9
+ if defined?(PageGroupPermissionsExtension)
10
+ # TODO: Create a scenario for groups
11
+ it "should display the group name" do
12
+ @page = pages(:home)
13
+ @page.group = Group.new(:name => "Testing")
14
+ @page.group_name.should == "Testing"
15
+ end
16
+ end
17
+
18
+ it "should display the status" do
19
+ pages(:home).status_name.should == "Published"
20
+ end
21
+
22
+ it "should display the parent page's title" do
23
+ pages(:radius).parent_title.should == pages(:home).title
24
+ end
25
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1,6 @@
1
+ --colour
2
+ --format
3
+ progress
4
+ --loadby
5
+ mtime
6
+ --reverse
@@ -0,0 +1,39 @@
1
+ unless defined? RADIANT_ROOT
2
+ ENV["RAILS_ENV"] = "test"
3
+ case
4
+ when ENV["RADIANT_ENV_FILE"]
5
+ require ENV["RADIANT_ENV_FILE"]
6
+ when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
7
+ require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
8
+ else
9
+ require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
10
+ end
11
+ end
12
+ require "#{RADIANT_ROOT}/spec/spec_helper"
13
+
14
+ # if File.directory?(File.dirname(__FILE__) + "/scenarios")
15
+ # Scenario.load_paths.unshift File.dirname(__FILE__) + "/scenarios"
16
+ # end
17
+ Dataset::Resolver.default << (File.dirname(__FILE__) + "/datasets")
18
+
19
+ if File.directory?(File.dirname(__FILE__) + "/matchers")
20
+ Dir[File.dirname(__FILE__) + "/matchers/*.rb"].each {|file| require file }
21
+ end
22
+
23
+ Spec::Runner.configure do |config|
24
+ # config.use_transactional_fixtures = true
25
+ # config.use_instantiated_fixtures = false
26
+ # config.fixture_path = RAILS_ROOT + '/spec/fixtures'
27
+
28
+ # You can declare fixtures for each behaviour like this:
29
+ # describe "...." do
30
+ # fixtures :table_a, :table_b
31
+ #
32
+ # Alternatively, if you prefer to declare them only once, you can
33
+ # do so here, like so ...
34
+ #
35
+ # config.global_fixtures = :table_a, :table_b
36
+ #
37
+ # If you declare global fixtures, be aware that they will be declared
38
+ # for all of your examples, even those that don't use them.
39
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: radiant-page_list_view-extension
3
+ version: !ruby/object:Gem::Version
4
+ hash: 57
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 9
9
+ - 1
10
+ version: 0.9.1
11
+ platform: ruby
12
+ authors:
13
+ - Andrew vonderLuft
14
+ - Sean Cribbs
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2011-04-20 00:00:00 -07:00
20
+ default_executable:
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: radiant
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ hash: 57
31
+ segments:
32
+ - 0
33
+ - 9
34
+ - 1
35
+ version: 0.9.1
36
+ type: :runtime
37
+ version_requirements: *id001
38
+ description: Enables viewing site pages in a list sortable by attibute.
39
+ email: avonderluft@avlux.net
40
+ executables: []
41
+
42
+ extensions: []
43
+
44
+ extra_rdoc_files:
45
+ - README.textile
46
+ files:
47
+ - .gitmodules
48
+ - HELP.textile
49
+ - README.textile
50
+ - Rakefile
51
+ - app/helpers/admin/list_view_helper.rb
52
+ - app/views/admin/pages/_page.html.haml
53
+ - app/views/admin/pages/page_list_view.html.haml
54
+ - config/routes.rb
55
+ - lib/page_list_view/admin_page_controller_extensions.rb
56
+ - lib/page_list_view/page_extensions.rb
57
+ - lib/tasks/page_list_view_extension_tasks.rake
58
+ - page_list_view_extension.rb
59
+ - pkg/radiant-page_list_view-extension-0.9.1.gem
60
+ - public/images/admin/application_cascade.png
61
+ - public/images/admin/application_side_tree.png
62
+ - public/images/admin/application_view_detail.png
63
+ - public/images/admin/application_view_list.png
64
+ - public/javascripts/admin/tablekit.js
65
+ - radiant-page_list_view-extension.gemspec
66
+ - spec/controllers/admin_page_controller_extensions_spec.rb
67
+ - spec/models/page_extensions_spec.rb
68
+ - spec/spec.opts
69
+ - spec/spec_helper.rb
70
+ has_rdoc: true
71
+ homepage: https://github.com/avonderluft/radiant-page_list_view-extension
72
+ licenses: []
73
+
74
+ post_install_message:
75
+ rdoc_options: []
76
+
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ hash: 3
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ hash: 3
94
+ segments:
95
+ - 0
96
+ version: "0"
97
+ requirements: []
98
+
99
+ rubyforge_project:
100
+ rubygems_version: 1.5.2
101
+ signing_key:
102
+ specification_version: 3
103
+ summary: Page List View Extension for Radiant CMS
104
+ test_files:
105
+ - spec/controllers/admin_page_controller_extensions_spec.rb
106
+ - spec/models/page_extensions_spec.rb
107
+ - spec/spec_helper.rb