open_conference_ware 1.0.0.pre1 → 1.0.0.pre2
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.
- data.tar.gz.sig +0 -0
- data/.gitignore +1 -0
- data/.travis.yml +0 -1
- data/CHANGES.md +27 -0
- data/{CONTRIBUTORS.markdown → CONTRIBUTORS.md} +0 -0
- data/Gemfile +2 -0
- data/{README.markdown → README.md} +32 -16
- data/app/assets/javascripts/open_conference_ware/base.js +0 -1
- data/app/assets/stylesheets/open_conference_ware/common.css.scss +6 -6
- data/app/assets/stylesheets/open_conference_ware/scaffold.css +0 -1
- data/app/controllers/open_conference_ware/proposals_controller.rb +4 -4
- data/app/helpers/open_conference_ware/application_helper.rb +1 -1
- data/app/helpers/open_conference_ware/time_range_helper.rb +1 -1
- data/app/helpers/open_conference_ware/tracks_helper.rb +1 -1
- data/app/mixins/open_conference_ware/faux_routes_mixin.rb +1 -1
- data/app/models/open_conference_ware/event.rb +6 -6
- data/app/models/open_conference_ware/proposal.rb +5 -5
- data/app/models/open_conference_ware/track.rb +1 -1
- data/app/views/open_conference_ware/_email_link.html.erb +1 -1
- data/app/views/open_conference_ware/authentications/_persona.html.erb +1 -1
- data/app/views/open_conference_ware/manage/events/_form.html.erb +3 -3
- data/app/views/open_conference_ware/manage/events/proposals.html.erb +1 -1
- data/app/views/open_conference_ware/manage/events/show.html.erb +3 -3
- data/app/views/open_conference_ware/proposals/_manage_speakers.html.erb +1 -1
- data/app/views/open_conference_ware/proposals/_schedule_control.html.erb +3 -3
- data/app/views/open_conference_ware/proposals/schedule.html.erb +3 -3
- data/app/views/open_conference_ware/proposals/show.html.erb +2 -2
- data/app/views/open_conference_ware/proposals/stats.html.erb +1 -1
- data/app/views/open_conference_ware/session_types/index.html.erb +1 -1
- data/app/views/open_conference_ware/tracks/index.html.erb +1 -1
- data/app/views/open_conference_ware/users/_block.html.erb +2 -2
- data/app/views/open_conference_ware/users/index.html.erb +1 -1
- data/lib/generators/open_conference_ware/install/templates/config_initializer.rb +3 -3
- data/lib/generators/open_conference_ware/install/templates/omniauth_initializer.rb +0 -1
- data/lib/generators/open_conference_ware/views/views_generator.rb +44 -0
- data/lib/open_conference_ware.rb +1 -1
- data/lib/open_conference_ware/dependencies.rb +0 -1
- data/lib/open_conference_ware/version.rb +1 -1
- data/lib/tasks/mediawiki.rake +2 -2
- data/lib/tasks/open_conference_ware_tasks.rake +0 -1
- data/lib/tasks/snippets.rake +1 -1
- data/open_conference_ware.gemspec +26 -28
- data/spec/controllers/open_conference_ware/application_controller_spec.rb +2 -2
- data/spec/controllers/open_conference_ware/events_controller_spec.rb +0 -1
- data/spec/controllers/open_conference_ware/proposals_controller_spec.rb +5 -5
- data/spec/controllers/open_conference_ware/rooms_controller_spec.rb +15 -15
- data/spec/controllers/open_conference_ware/session_types_controller_spec.rb +15 -15
- data/spec/controllers/open_conference_ware/sessions_routing_spec.rb +1 -1
- data/spec/controllers/open_conference_ware/tracks_controller_spec.rb +16 -16
- data/spec/dummy/config/initializers/01_open_conference_ware.rb +3 -3
- data/spec/fixtures/open_conference_ware_proposals.yml +10 -10
- data/spec/fixtures/open_conference_ware_schedule_items.yml +1 -1
- data/spec/fixtures/open_conference_ware_tracks.yml +3 -3
- data/spec/helpers/open_conference_ware/proposals_helper_spec.rb +1 -1
- data/spec/helpers/open_conference_ware/session_types_helper_spec.rb +2 -2
- data/spec/helpers/open_conference_ware/time_range_helper_spec.rb +4 -4
- data/spec/helpers/open_conference_ware/tracks_helper_spec.rb +2 -2
- data/spec/models/open_conference_ware/proposal_spec.rb +2 -2
- data/spec/spec_helper.rb +14 -6
- data/spec/support/add_all_helpers_to_view.rb +1 -1
- data/spec/support/fixture_shortcuts.rb +2 -3
- data/spec/views/open_conference_ware/proposals/_room_control.html.erb_spec.rb +0 -1
- data/spec/views/open_conference_ware/proposals/show.html.erb_spec.rb +6 -7
- data/spec/views/open_conference_ware/rooms/index.html.erb_spec.rb +0 -1
- data/spec/views/open_conference_ware/rooms/show.html.erb_spec.rb +0 -1
- data/spec/views/open_conference_ware/session_types/edit.html.erb_spec.rb +2 -4
- data/spec/views/open_conference_ware/session_types/index.html.erb_spec.rb +1 -2
- data/spec/views/open_conference_ware/session_types/new.html.erb_spec.rb +2 -4
- data/spec/views/open_conference_ware/session_types/show.html.erb_spec.rb +0 -1
- data/spec/views/open_conference_ware/tracks/edit.html.erb_spec.rb +2 -4
- data/spec/views/open_conference_ware/tracks/index.html.erb_spec.rb +1 -2
- data/spec/views/open_conference_ware/tracks/new.html.erb_spec.rb +2 -4
- data/spec/views/open_conference_ware/tracks/show.html.erb_spec.rb +0 -1
- data/spec/views/open_conference_ware/user_favorites/index.html.erb_spec.rb +0 -1
- metadata +98 -131
- metadata.gz.sig +0 -0
- data/Gemfile.lock +0 -296
- data/app/views/open_conference_ware/welcome/test.html.haml +0 -8
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<%
|
|
1
|
+
<%
|
|
2
2
|
proposal ||= @proposal
|
|
3
3
|
%>
|
|
4
4
|
|
|
5
5
|
<div id="proposal_schedule_control_container_<%= proposal.id %>" class="proposal_schedule_control_container proposal_control_container">
|
|
6
6
|
<%= form_for proposal do |f| -%>
|
|
7
7
|
<%= select_tag("start_time[date]", options_for_select( proposal.event.dates_for_select, proposal.start_time.try(:strftime, "%Y-%m-%d") ), :id => "start_time_date_#{proposal.id}", :class => 'date' ) %>
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
<%= select_hour proposal.start_time, {:prefix => 'start_time', :include_blank => true}, :id => "start_time_hour_#{proposal.id}", :class => 'hour' %>
|
|
10
10
|
<%= select_minute proposal.start_time, {:field_name => 'start_time', :minute_step => 5, :include_blank => true}, :id => "start_time_minute_#{proposal.id}", :class => 'minute' %>
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
<% end -%>
|
|
13
13
|
</div>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<ul>
|
|
24
24
|
<% for conflict in @schedule.room_conflicts %>
|
|
25
25
|
<li>
|
|
26
|
-
<em><%= conflict[:item].title %></em> vs. <em><%= conflict[:conflicts_with].title %></em>
|
|
26
|
+
<em><%= conflict[:item].title %></em> vs. <em><%= conflict[:conflicts_with].title %></em>
|
|
27
27
|
<% if conflict[:room] %>
|
|
28
28
|
in <%= conflict[:room].name %>
|
|
29
29
|
<% end %>
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
|
|
82
82
|
<table class='schedule'>
|
|
83
83
|
<% day.sections.each do |section| %>
|
|
84
|
-
<%
|
|
85
|
-
colspan = day.lcm_colspan / section.slices.size
|
|
84
|
+
<%
|
|
85
|
+
colspan = day.lcm_colspan / section.slices.size
|
|
86
86
|
rows = section.lcm_rowspan
|
|
87
87
|
%>
|
|
88
88
|
|
|
@@ -204,7 +204,7 @@ show_private_note = (can_edit?(@proposal) || selector?) && ! @proposal.note_to_o
|
|
|
204
204
|
<% if schedule_visible? && @proposal.start_time %>
|
|
205
205
|
<div class='proposal-scheduling'>
|
|
206
206
|
<b>Scheduled:</b>
|
|
207
|
-
<%= normalize_time(@proposal, :format => :html) %>
|
|
207
|
+
<%= normalize_time(@proposal, :format => :html) %>
|
|
208
208
|
<% if event_rooms? && @proposal.room %>
|
|
209
209
|
in
|
|
210
210
|
<span class='proposal-room'>
|
|
@@ -219,7 +219,7 @@ show_private_note = (can_edit?(@proposal) || selector?) && ! @proposal.note_to_o
|
|
|
219
219
|
</div>
|
|
220
220
|
<% end -%>
|
|
221
221
|
</div>
|
|
222
|
-
|
|
222
|
+
|
|
223
223
|
<% if proposal_excerpts? %>
|
|
224
224
|
<h3>Excerpt</h3>
|
|
225
225
|
<%= preserve_formatting_of @proposal.excerpt %>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<% for session_type in @session_types %>
|
|
4
4
|
<h3><%= link_to h(session_type.title), session_type_path(session_type) %></h3>
|
|
5
5
|
<span class="description"><%= display_textile_for session_type.description %></span>
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
<% if admin? %>
|
|
8
8
|
<div class='record-controls'>
|
|
9
9
|
<%= link_to 'Edit', edit_session_type_path(session_type), :class => "editable" %>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<% for track in @tracks %>
|
|
10
10
|
<h3 class='track block <%= track_css_class(track) %>'><%= link_to h(track.title), track_path(track) %></h3>
|
|
11
11
|
<span class="description"><%= display_textile_for track.description %></span>
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
<% if admin? %>
|
|
14
14
|
<div class='record-controls'>
|
|
15
15
|
<%= link_to 'Edit', edit_track_path(track), :class => "editable" %>
|
|
@@ -53,13 +53,13 @@ only_for_event = local_assigns[:only_for_event]
|
|
|
53
53
|
<%= display_textile_for user.biography %>
|
|
54
54
|
</div>
|
|
55
55
|
<% end %>
|
|
56
|
-
|
|
56
|
+
|
|
57
57
|
<% if can_edit?(user) %>
|
|
58
58
|
<div class='record-controls'>
|
|
59
59
|
<%= link_to "Edit user", edit_user_path(user), :class => "editable" %>
|
|
60
60
|
</div>
|
|
61
61
|
<% end %>
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
<% if display_sub_list %>
|
|
64
64
|
<%= render :partial => 'open_conference_ware/proposals/sub_list', :locals => { :container => user, :header_tag => :h4 } %>
|
|
65
65
|
<% else %>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<% if admin? && user.admin? %>
|
|
15
15
|
(<strong class='admin'>admin</strong>)
|
|
16
16
|
<% end %>
|
|
17
|
-
<%= link_to(user.label, user_path(user)) %><%= (", " + user.affiliation) unless user.affiliation.blank? %>
|
|
17
|
+
<%= link_to(user.label, user_path(user)) %><%= (", " + user.affiliation) unless user.affiliation.blank? %>
|
|
18
18
|
</td>
|
|
19
19
|
<% if admin? %>
|
|
20
20
|
<td nowrap="nowrap">
|
|
@@ -21,7 +21,7 @@ OpenConferenceWare.configure do |config|
|
|
|
21
21
|
#
|
|
22
22
|
# TODO: Setting the current event here is a short-term hack and will be replaced shortly with a Site record that tracks the current event in the database and provides a way to set it through an admin web UI.
|
|
23
23
|
# config.current_event_slug = '2012'
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
##[ OCW Features ]##
|
|
26
26
|
# Many features of OpenConferenceWare can be toggled via these settings
|
|
27
27
|
|
|
@@ -83,7 +83,7 @@ OpenConferenceWare.configure do |config|
|
|
|
83
83
|
#
|
|
84
84
|
# OCW can generate links to an external system, such as a wiki or an Etherpad
|
|
85
85
|
# instance, that provides a place for attendees to take notes.
|
|
86
|
-
|
|
86
|
+
|
|
87
87
|
# URL where OCW is installed
|
|
88
88
|
config.app_root_url = 'http://opensourcebridge.org/'
|
|
89
89
|
|
|
@@ -96,7 +96,7 @@ OpenConferenceWare.configure do |config|
|
|
|
96
96
|
config.session_notes_url_format = '%1$swiki/%2$s/'
|
|
97
97
|
|
|
98
98
|
##[ Optional Settings ]##
|
|
99
|
-
|
|
99
|
+
|
|
100
100
|
# Policy agreement to show on the proposal form
|
|
101
101
|
# If an agreement is set, presenters will be required to agree in order to submit a proposal.
|
|
102
102
|
#
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
class OpenConferenceWare::ViewsGenerator < Rails::Generators::Base
|
|
2
|
+
VIEWS_DIR = OpenConferenceWare::Engine.root.join('app','views')
|
|
3
|
+
OCW_VIEW_DIRS = Pathname.glob(VIEWS_DIR.join("open_conference_ware","*/")).map{|d| d.basename.to_s } + ["layouts"]
|
|
4
|
+
|
|
5
|
+
source_root VIEWS_DIR
|
|
6
|
+
desc <<-DESC
|
|
7
|
+
Copies OCW's views into your application. By default, all views will be copied.
|
|
8
|
+
|
|
9
|
+
Optionally, you can pass specific view directories as arguments.
|
|
10
|
+
|
|
11
|
+
Available directories:
|
|
12
|
+
- #{OCW_VIEW_DIRS.join("\n- ")}
|
|
13
|
+
|
|
14
|
+
DESC
|
|
15
|
+
argument :which_views,
|
|
16
|
+
type: :array,
|
|
17
|
+
default: ["all"],
|
|
18
|
+
desc: "Which view directories to copy. One or more of: #{OCW_VIEW_DIRS.join(' ')}",
|
|
19
|
+
banner: "VIEWS TO COPY"
|
|
20
|
+
|
|
21
|
+
def copy_views
|
|
22
|
+
directories_to_copy = if which_views.any?{|d| d == "all"}
|
|
23
|
+
OCW_VIEW_DIRS
|
|
24
|
+
else
|
|
25
|
+
which_views.select{|d| OCW_VIEW_DIRS.include?(d) }
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
directories_to_copy.each do |dir|
|
|
29
|
+
view_directory dir
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
protected
|
|
34
|
+
|
|
35
|
+
def view_directory(name)
|
|
36
|
+
path = if name == "layouts"
|
|
37
|
+
"layouts/open_conference_ware"
|
|
38
|
+
else
|
|
39
|
+
"open_conference_ware/#{name}"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
directory path, "app/views/#{path}"
|
|
43
|
+
end
|
|
44
|
+
end
|
data/lib/open_conference_ware.rb
CHANGED
data/lib/tasks/mediawiki.rake
CHANGED
|
@@ -36,7 +36,7 @@ For example:
|
|
|
36
36
|
def event_wiki_title(event)
|
|
37
37
|
return "Category:#{sanitize_string(event.title)}"
|
|
38
38
|
end
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
def tracks_wiki_title(event)
|
|
41
41
|
return "Category:#{sanitize_string(event.title)} tracks"
|
|
42
42
|
end
|
|
@@ -77,7 +77,7 @@ For example:
|
|
|
77
77
|
drone.replace_span "description", "#{textilize track.description}"
|
|
78
78
|
drone.save(true)
|
|
79
79
|
end
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
# Sessions
|
|
82
82
|
event.proposals.confirmed.includes(:event, :track, :session_type).each do |proposal|
|
|
83
83
|
drone = RwikibotPageDrone.new(wiki, session_wiki_title(proposal))
|
data/lib/tasks/snippets.rake
CHANGED
|
@@ -27,41 +27,39 @@ Gem::Specification.new do |s|
|
|
|
27
27
|
s.add_dependency "rails-observers", "~> 0.1.2"
|
|
28
28
|
|
|
29
29
|
# Authentication
|
|
30
|
-
s.add_dependency "omniauth",
|
|
30
|
+
s.add_dependency "omniauth", '~> 1.1.4'
|
|
31
31
|
|
|
32
|
-
s.add_dependency "hashery"
|
|
32
|
+
s.add_dependency "hashery", '~> 2.1.0'
|
|
33
33
|
|
|
34
|
-
s.add_dependency 'RedCloth'
|
|
35
|
-
s.add_dependency 'aasm'
|
|
36
|
-
s.add_dependency 'acts-as-taggable-on'
|
|
37
|
-
s.add_dependency 'color'
|
|
34
|
+
s.add_dependency 'RedCloth', '~> 4.2.0'
|
|
35
|
+
s.add_dependency 'aasm', '~> 3.0.0'
|
|
36
|
+
s.add_dependency 'acts-as-taggable-on', '~> 2.4.1'
|
|
37
|
+
s.add_dependency 'color', '~> 1.4.2'
|
|
38
38
|
s.add_dependency 'comma', '~> 3.0'
|
|
39
|
-
s.add_dependency 'gchartrb', '~> 0.8.0'
|
|
40
|
-
s.add_dependency 'paperclip'
|
|
41
|
-
s.add_dependency 'vpim'
|
|
42
|
-
s.add_dependency 'nokogiri'
|
|
43
|
-
s.add_dependency 'prawn'
|
|
44
|
-
s.add_dependency 'dalli'
|
|
45
|
-
s.add_dependency "dynamic_form"
|
|
46
|
-
s.add_dependency 'rinku'
|
|
39
|
+
s.add_dependency 'gchartrb', '~> 0.8.0'
|
|
40
|
+
s.add_dependency 'paperclip', '~> 3.5.2'
|
|
41
|
+
s.add_dependency 'vpim', '~> 13.11.11'
|
|
42
|
+
s.add_dependency 'nokogiri', '~> 1.6.0'
|
|
43
|
+
s.add_dependency 'prawn', '~> 0.12.0'
|
|
44
|
+
s.add_dependency 'dalli', '~> 2.6.4'
|
|
45
|
+
s.add_dependency "dynamic_form", '~> 1.1.4'
|
|
46
|
+
s.add_dependency 'rinku', '~> 1.7.3'
|
|
47
47
|
|
|
48
48
|
# Assets
|
|
49
|
-
s.add_dependency 'jquery-rails'
|
|
50
|
-
s.add_dependency 'sass-rails',
|
|
51
|
-
s.add_dependency 'uglifier'
|
|
49
|
+
s.add_dependency 'jquery-rails', '~> 3.0.0'
|
|
50
|
+
s.add_dependency 'sass-rails', '~> 4.0.0'
|
|
51
|
+
s.add_dependency 'uglifier', '~> 2.3.0'
|
|
52
52
|
|
|
53
53
|
# Development
|
|
54
|
-
s.add_development_dependency "sqlite3"
|
|
54
|
+
s.add_development_dependency "sqlite3", '~> 1.3.0'
|
|
55
55
|
|
|
56
56
|
# Testing
|
|
57
|
-
s.add_development_dependency '
|
|
58
|
-
s.add_development_dependency '
|
|
59
|
-
s.add_development_dependency 'capybara'
|
|
60
|
-
s.add_development_dependency 'factory_girl_rails'
|
|
61
|
-
s.add_development_dependency 'database_cleaner'
|
|
62
|
-
s.add_development_dependency 'cucumber-rails'
|
|
63
|
-
s.add_development_dependency '
|
|
64
|
-
s.add_development_dependency '
|
|
65
|
-
s.add_development_dependency 'cadre'
|
|
66
|
-
s.add_development_dependency 'coveralls'
|
|
57
|
+
s.add_development_dependency 'rspec-rails', '~> 2.14.0'
|
|
58
|
+
s.add_development_dependency 'omniauth-openid', '~> 1.0.0'
|
|
59
|
+
s.add_development_dependency 'capybara', '~> 2.2.0'
|
|
60
|
+
s.add_development_dependency 'factory_girl_rails', '~> 4.3.0'
|
|
61
|
+
s.add_development_dependency 'database_cleaner', '~> 1.2.0'
|
|
62
|
+
s.add_development_dependency 'cucumber-rails', '~> 1.4.0'
|
|
63
|
+
s.add_development_dependency 'simplecov', '~> 0.8.2'
|
|
64
|
+
s.add_development_dependency 'coveralls', '~> 0.7.0'
|
|
67
65
|
end
|
|
@@ -69,14 +69,14 @@ describe OpenConferenceWare::ApplicationController do
|
|
|
69
69
|
proposal = proposals(:quentin_widgets)
|
|
70
70
|
can_edit?(proposal).should be_true
|
|
71
71
|
end
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
it "should allow user to edit own before a status has been set" do
|
|
74
74
|
login_as :quentin
|
|
75
75
|
proposal = proposals(:quentin_widgets)
|
|
76
76
|
proposal.status = 'proposed'
|
|
77
77
|
can_edit?(proposal).should be_true
|
|
78
78
|
end
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
it "should not allow user to edit own once a status has been set" do
|
|
81
81
|
login_as :quentin
|
|
82
82
|
proposal = proposals(:quentin_widgets)
|
|
@@ -380,10 +380,10 @@ describe OpenConferenceWare::ProposalsController do
|
|
|
380
380
|
@key = 123
|
|
381
381
|
@event.stub(:proposal_status_published?).and_return(opts[:published])
|
|
382
382
|
stub_current_event!(event: @event)
|
|
383
|
-
|
|
383
|
+
|
|
384
384
|
@users = []
|
|
385
385
|
@users.stub(:by_name).and_return([])
|
|
386
|
-
|
|
386
|
+
|
|
387
387
|
@proposal = stub_model(Proposal, id: @key, event: @event, track: @event.tracks.empty? ? nil : Track.first, users: @users)
|
|
388
388
|
@proposal.stub(:confirmed?).and_return(opts[:confirmed])
|
|
389
389
|
controller.stub(:get_proposal_and_assignment_status).and_return([@proposal, :assigned_via_param])
|
|
@@ -791,7 +791,7 @@ describe OpenConferenceWare::ProposalsController do
|
|
|
791
791
|
proposal = assigns(:proposal)
|
|
792
792
|
proposal.errors.should_not be_empty
|
|
793
793
|
proposal.should_not be_valid
|
|
794
|
-
proposal.id.should be_nil
|
|
794
|
+
proposal.id.should be_nil
|
|
795
795
|
end
|
|
796
796
|
end
|
|
797
797
|
end
|
|
@@ -858,13 +858,13 @@ describe OpenConferenceWare::ProposalsController do
|
|
|
858
858
|
@proposal = proposals(:quentin_widgets)
|
|
859
859
|
@inputs = @proposal.attributes
|
|
860
860
|
end
|
|
861
|
-
|
|
861
|
+
|
|
862
862
|
it "should prevent editing of title when proposal titles are locked" do
|
|
863
863
|
@event = stub_current_event!
|
|
864
864
|
@event.stub(:proposal_titles_locked?).and_return(true)
|
|
865
865
|
@controller.stub(:get_proposal_and_assignment_status).and_return(@proposal)
|
|
866
866
|
@proposal.stub(:event).and_return(@event)
|
|
867
|
-
|
|
867
|
+
|
|
868
868
|
assert_update(:quentin, id: @proposal.id, title: 'OMG') do
|
|
869
869
|
@proposal.reload
|
|
870
870
|
@proposal.title.should_not == 'OMG'
|
|
@@ -4,12 +4,12 @@ describe OpenConferenceWare::RoomsController do
|
|
|
4
4
|
include OpenConferenceWare::RoomsHelper
|
|
5
5
|
fixtures :all
|
|
6
6
|
routes { OpenConferenceWare::Engine.routes }
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
before do
|
|
9
9
|
@event = stub_current_event!(event: events(:open))
|
|
10
10
|
@room = create(:room, event: @event)
|
|
11
11
|
end
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
describe "responding to GET index" do
|
|
14
14
|
|
|
15
15
|
it "should redirect to the rooms for the current event if none is given" do
|
|
@@ -32,7 +32,7 @@ describe OpenConferenceWare::RoomsController do
|
|
|
32
32
|
response.body.should == "generated XML"
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
describe "responding to GET show" do
|
|
@@ -42,7 +42,7 @@ describe OpenConferenceWare::RoomsController do
|
|
|
42
42
|
get :show, id: "37", event_id: @event.to_param
|
|
43
43
|
assigns(:room).should equal(@room)
|
|
44
44
|
end
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
describe "with mime type of xml" do
|
|
47
47
|
|
|
48
48
|
it "should render the requested room as xml" do
|
|
@@ -54,7 +54,7 @@ describe OpenConferenceWare::RoomsController do
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
end
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
describe "with an invalid room id" do
|
|
59
59
|
it "should redirect to the rooms index" do
|
|
60
60
|
Room.should_receive(:find).with("invalid").and_raise(ActiveRecord::RecordNotFound)
|
|
@@ -62,9 +62,9 @@ describe OpenConferenceWare::RoomsController do
|
|
|
62
62
|
response.should redirect_to(event_rooms_path(events(:open)))
|
|
63
63
|
end
|
|
64
64
|
end
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
end
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
describe "as an admin" do
|
|
69
69
|
before(:each) do
|
|
70
70
|
login_as(:aaron)
|
|
@@ -74,7 +74,7 @@ describe OpenConferenceWare::RoomsController do
|
|
|
74
74
|
before do
|
|
75
75
|
@new_room = Room.new
|
|
76
76
|
end
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
it "should expose a new room as @room" do
|
|
79
79
|
Room.should_receive(:new).and_return(@new_room)
|
|
80
80
|
get :new, event_id: @event.to_param
|
|
@@ -84,7 +84,7 @@ describe OpenConferenceWare::RoomsController do
|
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
describe "responding to GET edit" do
|
|
87
|
-
|
|
87
|
+
|
|
88
88
|
it "should expose the requested room as @room" do
|
|
89
89
|
Room.should_receive(:find).with("37").and_return(@room)
|
|
90
90
|
get :edit, id: "37", event_id: @event.to_param
|
|
@@ -99,7 +99,7 @@ describe OpenConferenceWare::RoomsController do
|
|
|
99
99
|
@valid_params = extract_valid_params(@room)
|
|
100
100
|
post :create, room: @valid_params, event_id: @event.to_param
|
|
101
101
|
end
|
|
102
|
-
|
|
102
|
+
|
|
103
103
|
it "should expose a newly created room as @room" do
|
|
104
104
|
extract_valid_params(assigns(:room)).should eq(@valid_params)
|
|
105
105
|
end
|
|
@@ -108,7 +108,7 @@ describe OpenConferenceWare::RoomsController do
|
|
|
108
108
|
response.should redirect_to(event_rooms_path(@event))
|
|
109
109
|
end
|
|
110
110
|
end
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
describe "with invalid params" do
|
|
113
113
|
before do
|
|
114
114
|
post :create, room: {capacity: 3}, event_id: @event.to_param
|
|
@@ -121,9 +121,9 @@ describe OpenConferenceWare::RoomsController do
|
|
|
121
121
|
it "should re-render the 'new' template" do
|
|
122
122
|
response.should render_template('new')
|
|
123
123
|
end
|
|
124
|
-
|
|
124
|
+
|
|
125
125
|
end
|
|
126
|
-
|
|
126
|
+
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
describe "responding to PUT update" do
|
|
@@ -146,7 +146,7 @@ describe OpenConferenceWare::RoomsController do
|
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
end
|
|
149
|
-
|
|
149
|
+
|
|
150
150
|
describe "with invalid params" do
|
|
151
151
|
before do
|
|
152
152
|
@room.should_receive(:update_attributes).and_return(false)
|
|
@@ -177,7 +177,7 @@ describe OpenConferenceWare::RoomsController do
|
|
|
177
177
|
@room.should_receive(:destroy)
|
|
178
178
|
delete :destroy, id: "37", event_id: @event.to_param
|
|
179
179
|
end
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
it "should redirect to the rooms list" do
|
|
182
182
|
Room.stub(:find).and_return(@room)
|
|
183
183
|
delete :destroy, id: "1", event_id: @event.to_param
|