Sha256: 91c4040b3a0d10d2529232ffe48b2147809be5f29faafba421b84b0e8d2d2973

Contents?: true

Size: 755 Bytes

Versions: 23

Compression:

Stored size: 755 Bytes

Contents

require 'spec/helper'

spec_require 'sequel'

begin
  DB = Sequel.sqlite
rescue NoMethodError
  raise LoadError, 'Install latest Sequel gem'
end

require 'ramaze/contrib/sequel/fill'

class Person < Sequel::Model(:person)
  set_schema do
    primary_key :id
    text :name
  end
end

Person.create_table!

class MainController < Ramaze::Controller
  def index
    'Hello, World!'
  end

  def insert
    person = Person.fill
    person.save
  end

  def show id
    Person[id.to_i].name
  end
end

describe 'Route' do
  behaves_like 'http'
  ramaze

  it 'should fill values from current request' do
    insert = get('/insert', 'name' => 'manveru')
    insert.status.should == 200
    person = get('/show/1')
    person.body.should == 'manveru'
  end
end

Version data entries

23 entries across 23 versions & 5 rubygems

Version Path
Pistos-ramaze-2008.09 spec/contrib/sequel/fill.rb
Pistos-ramaze-2008.12 spec/contrib/sequel/fill.rb
Pistos-ramaze-2009.01 spec/contrib/sequel/fill.rb
Pistos-ramaze-2009.02 spec/contrib/sequel/fill.rb
clivecrous-ramaze-0.3.9.5 spec/contrib/sequel/fill.rb
manveru-ramaze-2008.07 spec/contrib/sequel/fill.rb
manveru-ramaze-2008.08 spec/contrib/sequel/fill.rb
manveru-ramaze-2008.09 spec/contrib/sequel/fill.rb
manveru-ramaze-2008.10 spec/contrib/sequel/fill.rb
manveru-ramaze-2008.12 spec/contrib/sequel/fill.rb
manveru-ramaze-2009.01 spec/contrib/sequel/fill.rb
manveru-ramaze-2009.04.01 spec/contrib/sequel/fill.rb
ptomato-ramaze-2009.02.1 spec/contrib/sequel/fill.rb
ptomato-ramaze-2009.02 spec/contrib/sequel/fill.rb
ramaze-0.3.5 spec/contrib/sequel/fill.rb
ramaze-0.3.0 spec/contrib/sequel/fill.rb
ramaze-2008.11 spec/contrib/sequel/fill.rb
ramaze-0.3.9 spec/contrib/sequel/fill.rb
ramaze-2009.01 spec/contrib/sequel/fill.rb
ramaze-2008.06 spec/contrib/sequel/fill.rb