Skip to content
Browse files

adding spec test for retweet.

  • Loading branch information...
1 parent 88c408e commit 68ad1d583be41764f0c646ba31fc175431f074a2 @gleuch committed Nov 7, 2009
Showing with 58 additions and 0 deletions.
  1. +58 −0 retweet_spec.rb
View
58 retweet_spec.rb
@@ -0,0 +1,58 @@
+require 'rubygems'
+require 'sinatra'
+Sinatra::Application.environment = 'test'
+require 'spec'
+require 'sinatra/test/rspec'
+
+require 'retweet'
+
+Tweet.auto_migrate!
+User.auto_migrate!
+
+
+describe 'Retweet Fucker' do
+ # before(:all) do; end
+
+ # Index
+ it "should show an index" do
+ get '/'
+ @response.should be_ok
+ @response.body.should include('Connect your Twitter account')
+ end
+
+ # Retweeting
+ it "should allow retweet round if passkey is correct" do
+ get "/run/#{configatron.secret_launch_code}"
+ @response.should be_ok
+ @response.body.should_not include('Fuck off')
+ end
+
+ it "should not allow retweet round if passkey is correct" do
+ get "/run/fuck-this-#{configatron.secret_launch_code}"
+ @response.should be_ok
+ @response.body.should include('Fuck off')
+ end
+
+ # Forced retweeting
+ it "should allow forced retweet round if passkey is correct" do
+ get "/forced/#{configatron.secret_launch_code}?msg=TEST"
+ @response.should be_ok
+ @response.body.should_not include('Fuck off')
+ @response.body.should_not include('dumbass')
+ end
+
+ it "should not allow retweet round if no tweet given" do
+ get "/forced/#{configatron.secret_launch_code}"
+ @response.should be_ok
+ @response.body.should_not include('Fuck off')
+ @response.body.should include('dumbass')
+ end
+
+ it "should not allow retweet round if passkey is correct" do
+ get "/forced/fuck-this-#{configatron.secret_launch_code}?msg=TEST"
+ @response.should be_ok
+ @response.body.should include('Fuck off')
+ @response.body.should_not include('dumbass')
+ end
+
+end

0 comments on commit 68ad1d5

Please sign in to comment.
Something went wrong with that request. Please try again.