Changeset 1272

Show
Ignore:
Timestamp:
01/10/08 13:59:04 (9 months ago)
Author:
jon.egil.stra..@gmail.com
Message:

More specs run, and some cleaning in File upload. Still having trouble with the upload-spec though

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mrblog/branches/0.4.2/app/controllers/files.rb

    r1203 r1272  
    1111   
    1212  def upload 
    13     FileUtils.mv(params[:data][:tempfile].path,  
    14                  Merb::Server.config[:merb_root]+"/public/files/#{params[:data][:filename]}") 
    15     render_no_layout 
     13    # for testing check your terminal 
     14    puts "---------------------" 
     15    puts params.inspect     
     16    puts "---------------------" 
     17    # move 
     18    destination = MERB_ROOT + "/public/uploads/#{params[:file][:filename]}" 
     19    FileUtils.mv(params[:file][:tempfile].path, destination) 
     20    render 
    1621  end 
    1722   
  • mrblog/branches/0.4.2/app/views/files/start.html.erb

    r1203 r1272  
    3838  <dl> 
    3939    <dt><label>Select a file</label></dt> 
    40     <dd><input name="data" type="file" /></dd> 
     40    <dd><input name="file" type="file" /></dd> 
    4141  </dl> 
    42  
    4342 
    4443  <p> 
  • mrblog/branches/0.4.2/spec/models/user_spec.rb

    r1236 r1272  
    33 
    44describe User, "being authenticated" do 
     5  include TestData 
    56   
    67  before(:each) do  
    7     User.delete_all 
    8     @fred = User.create( 
    9                      :first_name            => 'Fred',  
    10                      :last_name             => 'Smith', 
    11                      :login                 => 'fsmith', 
    12                      :email                 => 'fred@smith.com', 
    13                      :password              => 'secret', 
    14                      :password_confirmation => 'secret', 
    15                      :created_at            => "'#{1.days.ago}'") 
     8    testdata_user 
    169  end 
    1710 
  • mrblog/branches/0.4.2/spec/spec_helper.rb

    r1203 r1272  
    88 
    99Spec::Runner.configure do |config| 
    10     config.include(Merb::Test::Helper) 
    11     config.include(Merb::Test::RspecMatchers) 
     10  config.include(Merb::Test::Helper) 
     11  config.include(Merb::Test::RspecMatchers) 
    1212end 
    1313 
     14require File.join(File.dirname(__FILE__), 'testdata') 
    1415 
    1516### METHODS BELOW THIS LINE SHOULD BE EXTRACTED TO MERB ITSELF