Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed RSS error for :all episodes #128

Merged
merged 1 commit into from
Mar 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def set_episode
@episode = Episode.active
else
if params[:episode] == 'all'
@episode = 'all'
@episode = :all
else
@episode = Episode.find_by(id: params[:episode])
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/_header.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
%ul.nav.navbar-nav.hidden-xs
%li.dropdown
= link_to(projects_path(@episode), {class: "navbar-brand"}) do
- if @episode == 'all'
- if @episode == :all
= "All Hackweeks"
- else
= @episode.name if @episode
= link_to('#', {class: "dropdown-toggle navbar-brand", "data-toggle"=>"dropdown"} ) do
%i.fa.fa-caret-square-o-down
%ul.dropdown-menu{:role => "menu"}
%li{:role => "presentation"}
= link_to(projects_path('all'), {title: "Projects for all hackweeks"}) do
= link_to(projects_path(:all), {title: "Projects for all hackweeks"}) do
All Hackweeks
- Episode.all.reverse.each do |episode|
%li{:role => "presentation"}
Expand Down
2 changes: 1 addition & 1 deletion app/views/projects/newest.rss.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
rel="self"
type="application/rss+xml")

-if @episode
-if @episode.is_a? Episode
%title Newest #{ @episode.name } projects
%description These are the newest projects for the #{ @episode.name }
-else
Expand Down
4 changes: 4 additions & 0 deletions spec/controllers/projects_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@
expect(xml.xpath('//item').count).to eq 10
expect(xml.xpath('//item/title').first.text).to eq project.title
end

it 'works for :all episodes' do
expect {get :newest, episode: :all, format: :rss}.not_to raise_error
end
end
end
end