Sha256: 5aea822bb645d9f35dfda92df62cbc706dc33d603c8abefd68143c4283b430d5

Contents?: true

Size: 791 Bytes

Versions: 7

Compression:

Stored size: 791 Bytes

Contents

require File.expand_path('../../../helper', __FILE__)
require File.expand_path('../../../../example/app/retro_games', __FILE__)

describe 'Retro-games app' do
  behaves_like :rack_test

  it 'lists the first game' do
    get '/'
    last_response.should =~ /1 => Pacman/
  end

  it 'has a form to add another game' do
    get '/'
    last_response.should =~ /<form/
  end

  it 'allows you to add another game' do
    response = post('/create', :name => 'Street Fighter II')
    response.status.should == 302

    follow_redirect!
    last_response.should =~ /0 =&gt; Street Fighter II/
  end

  it 'allows you to vote for a game' do
    get '/vote/Street+Fighter+II'
    follow_redirect!
    last_response.should =~ /1 =&gt; Street Fighter II/
  end

  FileUtils.rm_f('games.yaml')
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
innate-2023.01.06 spec/example/app/retro_games.rb
innate-2015.10.28 spec/example/app/retro_games.rb
innate-2013.02.21 spec/example/app/retro_games.rb
innate-2013.02 spec/example/app/retro_games.rb
innate-2012.12 spec/example/app/retro_games.rb
innate-2012.03 spec/example/app/retro_games.rb
innate-2011.12 spec/example/app/retro_games.rb