Created
November 20, 2012 11:12
-
-
Save swarut/4117330 to your computer and use it in GitHub Desktop.
Rspec : Rendering View #rspec #rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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