refinerycms-calendar 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/event_categories_controller.rb +9 -0
- data/app/controllers/admin/events_controller.rb +26 -0
- data/app/controllers/event_categories_controller.rb +10 -0
- data/app/controllers/events_controller.rb +64 -0
- data/app/helpers/event_categories_helper.rb +3 -0
- data/app/helpers/events_helper.rb +38 -0
- data/app/models/event.rb +72 -0
- data/app/models/event_categorization.rb +4 -0
- data/app/models/event_category.rb +10 -0
- data/app/views/admin/event_categories/_event_categories.html.erb +1 -0
- data/app/views/admin/event_categories/_event_category.html.erb +18 -0
- data/app/views/admin/event_categories/_form.html.erb +26 -0
- data/app/views/admin/event_categories/_sortable_list.html.erb +3 -0
- data/app/views/admin/event_categories/edit.html.erb +1 -0
- data/app/views/admin/event_categories/index.html.erb +40 -0
- data/app/views/admin/event_categories/new.html.erb +1 -0
- data/app/views/admin/events/_event.html.erb +18 -0
- data/app/views/admin/events/_events.html.erb +1 -0
- data/app/views/admin/events/_form.html.erb +126 -0
- data/app/views/admin/events/_sortable_list.html.erb +20 -0
- data/app/views/admin/events/edit.html.erb +1 -0
- data/app/views/admin/events/index.html.erb +41 -0
- data/app/views/admin/events/new.html.erb +1 -0
- data/app/views/event_categories/show.html.erb +15 -0
- data/app/views/events/_event.html.erb +103 -0
- data/app/views/events/_sidebar.html.erb +38 -0
- data/app/views/events/archive.html.erb +17 -0
- data/app/views/events/index.html.erb +17 -0
- data/app/views/events/index.rss.builder +24 -0
- data/app/views/events/show.html.erb +15 -0
- data/changelog.md +22 -0
- data/config/locales/en.yml +39 -0
- data/config/locales/lolcat.yml +24 -0
- data/config/locales/nb.yml +20 -0
- data/config/locales/nl.yml +20 -0
- data/config/routes.rb +11 -0
- data/db/migrate/01_create_events.rb +33 -0
- data/db/migrate/02_create_event_categories.rb +13 -0
- data/db/migrate/03_create_event_categorizations.rb +17 -0
- data/db/seeds/events.rb +17 -0
- data/features/manage_events.feature +64 -0
- data/features/step_definitions/event_steps.rb +14 -0
- data/features/support/factories/event_categories.rb +3 -0
- data/features/support/factories/events.rb +6 -0
- data/features/support/paths.rb +17 -0
- data/lib/generators/refinerycms_events_generator.rb +6 -0
- data/lib/refinerycms-events.rb +23 -0
- data/lib/tasks/events.rake +13 -0
- data/public/stylesheets/refinerycms-events.css +73 -0
- data/readme.md +49 -0
- data/refinerycms-calendar.gemspec +17 -0
- data/spec/controllers/events_controller_spec.rb +14 -0
- data/spec/helpers/events_helper_spec.rb +16 -0
- data/spec/models/event_category_spec.rb +29 -0
- data/spec/models/event_spec.rb +82 -0
- metadata +133 -0
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
Dir[File.expand_path('../../../features/support/factories/*.rb', __FILE__)].each{|factory| require factory}
|
3
|
+
|
4
|
+
describe Event do
|
5
|
+
|
6
|
+
def reset_event(options = {})
|
7
|
+
@valid_attributes = {
|
8
|
+
:id => 1,
|
9
|
+
:title => "RSpec is great for testing too"
|
10
|
+
}
|
11
|
+
|
12
|
+
@event.destroy! if @event
|
13
|
+
@event = Event.create!(@valid_attributes.update(options))
|
14
|
+
end
|
15
|
+
|
16
|
+
context "validations" do
|
17
|
+
|
18
|
+
before(:each) do
|
19
|
+
reset_event
|
20
|
+
end
|
21
|
+
|
22
|
+
it "rejects empty title" do
|
23
|
+
Event.new(@valid_attributes.merge(:title => "")).should_not be_valid
|
24
|
+
end
|
25
|
+
|
26
|
+
it "rejects non unique title" do
|
27
|
+
# as one gets created before each spec by reset_event
|
28
|
+
Event.new(@valid_attributes).should_not be_valid
|
29
|
+
end
|
30
|
+
|
31
|
+
it "rejects a non-numerical ticket price" do
|
32
|
+
Event.new({
|
33
|
+
:title => "I have a bad ticket price",
|
34
|
+
:ticket_price => "$25"
|
35
|
+
}).should_not be_valid
|
36
|
+
|
37
|
+
Event.new({
|
38
|
+
:title => "I have a good ticket price",
|
39
|
+
:ticket_price => "25"
|
40
|
+
}).should be_valid
|
41
|
+
|
42
|
+
Event.new({
|
43
|
+
:title => "I have a decimal ticket price",
|
44
|
+
:ticket_price => "25.00"
|
45
|
+
}).should be_valid
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context "instance methods" do
|
50
|
+
it "can find the next item" do
|
51
|
+
event1 = Factory(:event)
|
52
|
+
event2 = Factory(:event, :start_at => Time.now.advance(:days => 1), :end_at => Time.now.advance(:days => 1, :hours => 1))
|
53
|
+
event1.next.should == event2
|
54
|
+
end
|
55
|
+
|
56
|
+
it "can find the previous item" do
|
57
|
+
event1 = Factory(:event)
|
58
|
+
event2 = Factory(:event, :start_at => Time.now.advance(:days => 1), :end_at => Time.now.advance(:days => 1, :hours => 1))
|
59
|
+
event2.prev.should == event1
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context "categories" do
|
64
|
+
it "has many categories" do
|
65
|
+
event = Factory(:event)
|
66
|
+
event.should respond_to :categories
|
67
|
+
end
|
68
|
+
|
69
|
+
it "can be assigned categories" do
|
70
|
+
event = Factory(:event)
|
71
|
+
cat1 = Factory(:event_category)
|
72
|
+
cat2 = Factory(:event_category)
|
73
|
+
|
74
|
+
event.categories << cat1
|
75
|
+
event.categories << cat2
|
76
|
+
|
77
|
+
event.categories.size.should be 2
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
metadata
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: refinerycms-calendar
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
version: "1.0"
|
9
|
+
platform: ruby
|
10
|
+
authors:
|
11
|
+
- Neoteric Design
|
12
|
+
- Joe Sak
|
13
|
+
- Philip Arndt
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-03-03 00:00:00 -06:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: refinerycms
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 9
|
32
|
+
- 9
|
33
|
+
version: 0.9.9
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
description: Ruby on Rails Events engine for Refinery CMS
|
37
|
+
email: joe@neotericdesign.com
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files: []
|
43
|
+
|
44
|
+
files:
|
45
|
+
- app/controllers/admin/event_categories_controller.rb
|
46
|
+
- app/controllers/admin/events_controller.rb
|
47
|
+
- app/controllers/event_categories_controller.rb
|
48
|
+
- app/controllers/events_controller.rb
|
49
|
+
- app/helpers/event_categories_helper.rb
|
50
|
+
- app/helpers/events_helper.rb
|
51
|
+
- app/models/event.rb
|
52
|
+
- app/models/event_categorization.rb
|
53
|
+
- app/models/event_category.rb
|
54
|
+
- app/views/admin/event_categories/_event_categories.html.erb
|
55
|
+
- app/views/admin/event_categories/_event_category.html.erb
|
56
|
+
- app/views/admin/event_categories/_form.html.erb
|
57
|
+
- app/views/admin/event_categories/_sortable_list.html.erb
|
58
|
+
- app/views/admin/event_categories/edit.html.erb
|
59
|
+
- app/views/admin/event_categories/index.html.erb
|
60
|
+
- app/views/admin/event_categories/new.html.erb
|
61
|
+
- app/views/admin/events/_event.html.erb
|
62
|
+
- app/views/admin/events/_events.html.erb
|
63
|
+
- app/views/admin/events/_form.html.erb
|
64
|
+
- app/views/admin/events/_sortable_list.html.erb
|
65
|
+
- app/views/admin/events/edit.html.erb
|
66
|
+
- app/views/admin/events/index.html.erb
|
67
|
+
- app/views/admin/events/new.html.erb
|
68
|
+
- app/views/event_categories/show.html.erb
|
69
|
+
- app/views/events/_event.html.erb
|
70
|
+
- app/views/events/_sidebar.html.erb
|
71
|
+
- app/views/events/archive.html.erb
|
72
|
+
- app/views/events/index.html.erb
|
73
|
+
- app/views/events/index.rss.builder
|
74
|
+
- app/views/events/show.html.erb
|
75
|
+
- changelog.md
|
76
|
+
- config/locales/en.yml
|
77
|
+
- config/locales/lolcat.yml
|
78
|
+
- config/locales/nb.yml
|
79
|
+
- config/locales/nl.yml
|
80
|
+
- config/routes.rb
|
81
|
+
- db/migrate/01_create_events.rb
|
82
|
+
- db/migrate/02_create_event_categories.rb
|
83
|
+
- db/migrate/03_create_event_categorizations.rb
|
84
|
+
- db/seeds/events.rb
|
85
|
+
- features/manage_events.feature
|
86
|
+
- features/step_definitions/event_steps.rb
|
87
|
+
- features/support/factories/event_categories.rb
|
88
|
+
- features/support/factories/events.rb
|
89
|
+
- features/support/paths.rb
|
90
|
+
- lib/generators/refinerycms_events_generator.rb
|
91
|
+
- lib/refinerycms-events.rb
|
92
|
+
- lib/tasks/events.rake
|
93
|
+
- public/stylesheets/refinerycms-events.css
|
94
|
+
- readme.md
|
95
|
+
- refinerycms-calendar.gemspec
|
96
|
+
- spec/controllers/events_controller_spec.rb
|
97
|
+
- spec/helpers/events_helper_spec.rb
|
98
|
+
- spec/models/event_category_spec.rb
|
99
|
+
- spec/models/event_spec.rb
|
100
|
+
has_rdoc: true
|
101
|
+
homepage: https://github.com/resolve/refinerycms-calendar
|
102
|
+
licenses: []
|
103
|
+
|
104
|
+
post_install_message:
|
105
|
+
rdoc_options: []
|
106
|
+
|
107
|
+
require_paths:
|
108
|
+
- lib
|
109
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
segments:
|
115
|
+
- 0
|
116
|
+
version: "0"
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
segments:
|
123
|
+
- 0
|
124
|
+
version: "0"
|
125
|
+
requirements: []
|
126
|
+
|
127
|
+
rubyforge_project:
|
128
|
+
rubygems_version: 1.3.7
|
129
|
+
signing_key:
|
130
|
+
specification_version: 3
|
131
|
+
summary: Events engine for Refinery CMS
|
132
|
+
test_files: []
|
133
|
+
|