Save_and_open_page在cucumber / capybara中是空白的,但在rspec请求规范中没有

时间:2012-03-27 03:30:46

标签: ruby-on-rails rspec cucumber capybara

我很困惑为什么我的save_and_open_page在我的请求规范中有效,但在此黄瓜功能/网页步骤中却没有。它适用于其他功能/网络步骤文件。

我喜欢指向哪里开始寻找此问题根本原因的指针。

https://gist.github.com/2210420

好吧,我认为在使用pry时可能与此编码错误有关?

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>)> 

编码错误:输出转换因转换错误而失败,字节0xA3 0xC3 0x8F 0xC3     I / O错误:编码器错误

1 个答案:

答案 0 :(得分:0)

通过从许可证夹具中删除pdf文件来修复。