spec/cells/cell_spec_spec.rb in rspec-cells-0.1.12 vs spec/cells/cell_spec_spec.rb in rspec-cells-0.2.0

- old
+ new

@@ -20,45 +20,45 @@ include CellExampleGroup end end it "adds :type => :cell to the metadata" do - group.metadata[:type].should eq(:cell) + expect(group.metadata[:type]).to eq(:cell) end describe "#render_cell" do it "renders a state" do - group.new.render_cell(:dummy, :show).should == "<p>I'm Dummy.</p>" + expect(group.new.render_cell(:dummy, :show)).to eq("<p>I'm Dummy.</p>") end it "allows passing state args" do - group.new.render_cell(:dummy, :update, "this").should == "Updating this." + expect(group.new.render_cell(:dummy, :update, "this")).to eq('Updating this.') end end it "responds to #cell" do - group.new.cell(:dummy).should be_kind_of(DummyCell) + expect(group.new.cell(:dummy)).to be_kind_of(DummyCell) end # FIXME: could anyone make capybara/rails work in these tests? # it "allows using matchers with #render_state" do - # cell(:dummy).render_state(:show).should have_selector("p") + # expect(cell(:dummy).render_state(:show)).to have_selector("p") # end context "as a test writer" do include CellExampleGroup it "should support _path helpers from the controller" do # We have to stub include so that things determine the route exists. - Rails.application.routes.named_routes.helpers.stub(:include?).and_return(:true) - @controller.should_receive(:test_path).at_least(:once) + allow(Rails.application.routes.named_routes.helpers).to receive(:include?).and_return(true) + expect(@controller).to receive(:test_path).at_least(:once) test_path end it "should support polymorphic_path from the controller" do # We have to stub include so that things determine the route exists. - Rails.application.routes.named_routes.helpers.stub(:include?).and_return(:true) - @controller.should_receive(:test_path).at_least(:once) + allow(Rails.application.routes.named_routes.helpers).to receive(:include?).and_return(true) + expect(@controller).to receive(:test_path).at_least(:once) polymorphic_path(:test) end end end