Sha256: 44ed7f3f8a9cb50911dbbc4b6f4d7bd8d4786d7ae28c5d55b38478263f439328

Contents?: true

Size: 1.08 KB

Versions: 11

Compression:

Stored size: 1.08 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe RegistrationRepository do
  
  it 'should create a new registration form when the key is unknown' do
    form = RegistrationRepository.new.find()
    form[:name].should eql("")
    form[:address].should eql("")
    form[:email].should eql("")
    #form[:key].should eql(3)
  end  
  
  it 'should save a regsistration form' do
    form = RegistrationFormBuilder.new.build(1)
    form.update(:name => "Sarah")
    RegistrationRepository.new.save(form)
    
    registration =  Registration[:id => form[:key]]
    registration.should_not be_nil
    registration.name.should eql("Sarah")
    
    registration.delete
  end
  
  it 'should find a registration form' do
    registration = Registration.create(:name => "sarah", :email => "sarah@me", :address => "Hi")
    registration.save
    
    form = RegistrationRepository.new.find(registration.id)
    form[:name].should eql("sarah")
    form[:address].should eql("Hi")
    form[:email].should eql("sarah@me")
    form[:key].should eql(registration.id)
    
    registration.delete
  end
  
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
starapor-slippers-0.0.2 examples/forms/spec/registration_repository_spec.rb
starapor-slippers-0.0.3 examples/forms/spec/registration_repository_spec.rb
starapor-slippers-0.0.5 examples/forms/spec/registration_repository_spec.rb
starapor-slippers-0.0.6 examples/forms/spec/registration_repository_spec.rb
starapor-slippers-0.0.8 examples/forms/spec/registration_repository_spec.rb
starapor-slippers-0.0.9 examples/forms/spec/registration_repository_spec.rb
slippers-0.0.14 examples/forms/spec/registration_repository_spec.rb
slippers-0.0.13 examples/forms/spec/registration_repository_spec.rb
slippers-0.0.12 examples/forms/spec/registration_repository_spec.rb
slippers-0.0.11 examples/forms/spec/registration_repository_spec.rb
slippers-0.0.10 examples/forms/spec/registration_repository_spec.rb