Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adding spec test for retweet.

  • Loading branch information...
commit 68ad1d583be41764f0c646ba31fc175431f074a2 1 parent 88c408e
Greg Leuch authored

Showing 1 changed file with 58 additions and 0 deletions. Show diff stats Hide diff stats

  1. +58 0 retweet_spec.rb
58 retweet_spec.rb
... ... @@ -0,0 +1,58 @@
  1 +require 'rubygems'
  2 +require 'sinatra'
  3 +Sinatra::Application.environment = 'test'
  4 +require 'spec'
  5 +require 'sinatra/test/rspec'
  6 +
  7 +require 'retweet'
  8 +
  9 +Tweet.auto_migrate!
  10 +User.auto_migrate!
  11 +
  12 +
  13 +describe 'Retweet Fucker' do
  14 + # before(:all) do; end
  15 +
  16 + # Index
  17 + it "should show an index" do
  18 + get '/'
  19 + @response.should be_ok
  20 + @response.body.should include('Connect your Twitter account')
  21 + end
  22 +
  23 + # Retweeting
  24 + it "should allow retweet round if passkey is correct" do
  25 + get "/run/#{configatron.secret_launch_code}"
  26 + @response.should be_ok
  27 + @response.body.should_not include('Fuck off')
  28 + end
  29 +
  30 + it "should not allow retweet round if passkey is correct" do
  31 + get "/run/fuck-this-#{configatron.secret_launch_code}"
  32 + @response.should be_ok
  33 + @response.body.should include('Fuck off')
  34 + end
  35 +
  36 + # Forced retweeting
  37 + it "should allow forced retweet round if passkey is correct" do
  38 + get "/forced/#{configatron.secret_launch_code}?msg=TEST"
  39 + @response.should be_ok
  40 + @response.body.should_not include('Fuck off')
  41 + @response.body.should_not include('dumbass')
  42 + end
  43 +
  44 + it "should not allow retweet round if no tweet given" do
  45 + get "/forced/#{configatron.secret_launch_code}"
  46 + @response.should be_ok
  47 + @response.body.should_not include('Fuck off')
  48 + @response.body.should include('dumbass')
  49 + end
  50 +
  51 + it "should not allow retweet round if passkey is correct" do
  52 + get "/forced/fuck-this-#{configatron.secret_launch_code}?msg=TEST"
  53 + @response.should be_ok
  54 + @response.body.should include('Fuck off')
  55 + @response.body.should_not include('dumbass')
  56 + end
  57 +
  58 +end

0 comments on commit 68ad1d5

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