unexpected =>, expecting '}' in rspec expect

后端 未结 2 1402
别跟我提以往
别跟我提以往 2021-01-27 05:21

I have this code:

adapter.send(:conditions_to_fields, :user => user).should == {\'owner_id\' => user.id}

which I updated to use expect wi

2条回答
  •  鱼传尺愫
    2021-01-27 06:03

    One way to overcome this is to use Hash instead of {}

    e.g.

    expect(adapter.send(:conditions_to_fields, :pwner => user)).to eq \
    Hash('owner_id' => user.id, 'owner_type' => user.class.name)
    

提交回复
热议问题