Sha256: 52cc346ca8d3a01fe7997d4718836194821fd159073f2f274f647ef86e00ee92

Contents?: true

Size: 671 Bytes

Versions: 2

Compression:

Stored size: 671 Bytes

Contents

require 'spec/helper'
require 'examples/simple_auth'

describe "SimpleAuth" do
  behaves_like 'browser'
  ramaze(:adapter => :webrick)

  it 'should show start page' do
    Browser.new do
      http.basic_authentication "username", "password"
      get('/').should == "Secret Info"
    end

    Browser.new do
      http.basic_authentication "admin", "secret"
      get('/').should == "Secret Info"
    end
  end

  it 'should not show start page' do
    Browser.new do
      lambda{ get('/') }.should.raise
    end

    Browser.new do
      lambda do
        http.basic_authentication "hello", "world"
        lambda{ get('/') }.should.raise
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
clivecrous-ramaze-0.3.9.5 spec/examples/simple_auth.rb
ramaze-0.3.9.1 spec/examples/simple_auth.rb