Sha256: 7f9a0a6c32d3a25edf25b71f907a672dbba44b664eef9748c910a668299d08ad

Contents?: true

Size: 586 Bytes

Versions: 15

Compression:

Stored size: 586 Bytes

Contents

require 'rails_helper'

RSpec.describe "products/index", :type => :view do
  before(:each) do
    assign(:products, [
      Product.create!(
        :name => "Name",
        :code => "Code",
        :price => "9.99"
      ),
      Product.create!(
        :name => "Name",
        :code => "Code",
        :price => "9.99"
      )
    ])
  end

  it "renders a list of products" do
    render
    assert_select "tr>td", :text => "Name".to_s, :count => 2
    assert_select "tr>td", :text => "Code".to_s, :count => 2
    assert_select "tr>td", :text => "9.99".to_s, :count => 2
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
restspec-0.3.2 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.3.1 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.3.0 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.2.6 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.2.5 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.2.4 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.2.3 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.2.2 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.2.1 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.2 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.1 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.0.4 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.0.3 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.0.2 examples/store-api/spec/views/products/index.html.erb_spec.rb
restspec-0.0.1 examples/store-api/spec/views/products/index.html.erb_spec.rb