2012-03-27 107 views
1

我很困惑,为什么我的save_and_open_page在我的请求规范中工作,但不在这个黄瓜特征/网页步骤中。它可以在其他功能/网页步骤文件中使用。Save_and_open_page在黄瓜/水豚空白,但不在rspec请求规范

我很想知道从哪里开始寻找这个问题的根本原因。

https://gist.github.com/2210420

确定,我认为它可能有一些与此编码错误做,当我使用撬?

From: /Users/ivan/dev/c4c/features/step_definitions/licenses_steps.rb @ line 20: 

15:  name: arg1, 
16:  status: ExpressLicenseTechnology::PUBLISHED_STATUS) 
17: end 
18: 
19: When /^I am on the license page for "([^"]*)"$/ do |arg1| 
=> 20: binding.pry 
21: visit(license_path(License.find_by_name(arg1) 
22:)) 
23: end 
24: 
25: Then /^I should see a form for licensee info$/ do 

[1] pry(#<Cucumber::Rails::World>)> arg1 
=> "test no fee license" 
[2] pry(#<Cucumber::Rails::World>)> License.find_by_name(arg1) 
=> #<License id: 3, name: "test no fee license", description: "license one description", status: "published", allow_edu: nil, allow_other: nil, allow_org: nil, allow_us_gov: nil, require_contact_info: nil, show_contact_info_form: nil, way: "clickthrough", express_license_technology_id: 1, created_at: "2012-03-27 16:39:41", updated_at: "2012-03-27 16:39:41", licensefile_file_name: "test-license.pdf", licensefile_content_type: "application/pdf", licensefile_file_size: 516650, licensefile_updated_at: "2012-03-27 16:39:41", fee: #<BigDecimal:7ffcb1310820,'0.154E3',9(18)>, allocation_rule_number: "66", fulfillment_email: nil> 
[3] pry(#<Cucumber::Rails::World>)> ap License.find_by_name(arg1) 

#<License:0x007ffcabf00b68> { 
           :id => 3, 
          :name => "test no fee license", 
         :description => "license one description", 
          :status => "published", 
         :allow_edu => nil, 
         :allow_other => nil, 
         :allow_org => nil, 
        :allow_us_gov => nil, 
      :require_contact_info => nil, 
      :show_contact_info_form => nil, 
           :way => "clickthrough", 
    :express_license_technology_id => 1, 
         :created_at => Tue, 27 Mar 2012 16:39:41 UTC +00:00, 
         :updated_at => Tue, 27 Mar 2012 16:39:41 UTC +00:00, 
      :licensefile_file_name => "test-license.pdf", 
     :licensefile_content_type => "application/pdf", 
      :licensefile_file_size => 516650, 
      :licensefile_updated_at => Tue, 27 Mar 2012 16:39:41 UTC +00:00, 
           :fee => 154.0, 
      :allocation_rule_number => "66", 
       :fulfillment_email => nil 
} 
=> #<License id: 3, name: "test no fee license", description: "license one description", status: "published", allow_edu: nil, allow_other: nil, allow_org: nil, allow_us_gov: nil, require_contact_info: nil, show_contact_info_form: nil, way: "clickthrough", express_license_technology_id: 1, created_at: "2012-03-27 16:39:41", updated_at: "2012-03-27 16:39:41", licensefile_file_name: "test-license.pdf", licensefile_content_type: "application/pdf", licensefile_file_size: 516650, licensefile_updated_at: "2012-03-27 16:39:41", fee: #<BigDecimal:7ffcabf01428,'0.154E3',9(18)>, allocation_rule_number: "66", fulfillment_email: nil> 
[4] pry(#<Cucumber::Rails::World>)> license_path(License.find_by_name(arg1)) 
=> "/licenses/3" 
[5] pry(#<Cucumber::Rails::World>)> visit(license_path(License.find_by_name(arg1))) 
=> nil 
[6] pry(#<Cucumber::Rails::World>)> save_and_open_page 
encoding error : output conversion failed due to conv error, bytes 0xA3 0xC3 0x8F 0xC3 
I/O error : encoder error 
=> #<Thread:0x007ffcb1280f40 sleep> 
[7] pry(#<Cucumber::Rails::World>)> 

编码误差:输出转换失败由于CONV误差,字节0xA3执行0xC3值为0x8F 0xC3 I/O错误:编码器错误

回答

0

通过从许可证夹具去除pdf文件固定。