Skip to content

Instantly share code, notes, and snippets.

@swarut
Created November 20, 2012 11:12
Show Gist options
  • Save swarut/4117330 to your computer and use it in GitHub Desktop.
Save swarut/4117330 to your computer and use it in GitHub Desktop.
Rspec : Rendering View #rspec #rails
require 'spec_helper'
describe FeedsController do
let!(:user) { User.make!(:registered) }
render_views
describe "GET 'events'" do
it "successfully responds to ICS format" do
get 'events', :format => :ics, :token => user.feed_token
response.should be_success
end
end
describe "GET 'officehours'" do
it "successfully responds to ICS format" do
get 'officehours', :format => :ics, :token => user.feed_token
response.should be_success
end
it "exclude the past officehours" do
Availability.make!( starts_at: Time.zone.now.midnight - 10.days + rand(5).hours)
Availability.make!( starts_at: Time.zone.now.tomorrow.midnight + 2.days + rand(5).hours)
get 'officehours', :format => :ics, :token => user.feed_token
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment