-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created Sinatra version of Rails examples_controller and tests for it
- Loading branch information
Igor Tryus
authored and
Igor Tryus
committed
Oct 29, 2012
1 parent
985a6b4
commit e12ad8a
Showing
2 changed files
with
101 additions
and
68 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
require File.dirname(__FILE__) + '/hello.rb' | ||
require 'rack/test' | ||
|
||
set :enviroment, :test | ||
|
||
def app | ||
Sinatra::Application | ||
end | ||
|
||
# GET /pub/:message | ||
describe "responding to GET pub" do | ||
include Rack::Test::Methods | ||
|
||
it "should send message" do | ||
get '/pub/hi' | ||
|
||
last_response.should be_ok | ||
end | ||
|
||
end | ||
|
||
# GET /time | ||
describe "responding to GET time" do | ||
include Rack::Test::Methods | ||
|
||
it "should return server time" do | ||
get '/time' | ||
|
||
last_response.should be_ok | ||
end | ||
|
||
end | ||
|
||
# GET /uuid | ||
describe "responding to GET uuid" do | ||
include Rack::Test::Methods | ||
|
||
it "should return session UUID" do | ||
|
||
get '/uuid' | ||
|
||
last_response.should be_ok | ||
end | ||
|
||
end | ||
|
||
# GET /here_now | ||
describe "responding to GET here_now" do | ||
include Rack::Test::Methods | ||
|
||
it "should return current occupancy status of the channel" do | ||
|
||
get '/here_now' | ||
|
||
last_response.should be_ok | ||
end | ||
|
||
end | ||
|
||
# GET /history | ||
describe "responding to GET history" do | ||
include Rack::Test::Methods | ||
|
||
it "should return the last 5 messages published to the channel" do | ||
get '/history' | ||
|
||
last_response.should be_ok | ||
end | ||
|
||
end | ||
|
||
# GET /detailed_history | ||
describe "responding to GET detailed_history" do | ||
include Rack::Test::Methods | ||
|
||
it "should return archive messages of on a given channel" do | ||
get '/detailed_history' | ||
|
||
last_response.should be_ok | ||
end | ||
|
||
end | ||
|
||
|