1

我是 ruby​​ 的新手,我正在尝试找出原因background_image,并且keyline_image两者都没有出现。

context 'removing background_image but not keyline_image' do
    before do
      put :update, id: business_group.id,
          business_group: { title: 'new_title',
              background_image: File.new('spec/support/files/test_photo.jpg'),
              keyline_image:  File.new('spec/support/files/test_photo.jpg') },
          remove_background_image: 1,
          remove_keyline_image: nil

      business_group.reload
      binding.pry
    end
    it { business_group.title.should == "new_title"}
    it { business_group.background_image.should_not be_nil }
    it { business_group.keyline_image.should_not be_nil}
  end

我做了一个 binding.pry 并得到以下输出:

BusinessGroup.find(business_group.id).background_image
     => <Dragonfly Attachment uid="2013/02/07/12_58_16_754_file", app=:images>

business_group.background_image
     => nil

评论赞赏

4

0 回答 0