Sha256: 838cf46591ba9fce6456bcd131cff8b5bba3b90850679066cad4c86850d483ac

Contents?: true

Size: 1004 Bytes

Versions: 23

Compression:

Stored size: 1004 Bytes

Contents

# -*- encoding : utf-8 -*-

RSpec.describe Card::Set::Abstract::Pointer do
  describe "json" do
    include_context "json context"

    def card_subject
      sample_pointer
    end

    let(:item_names) { %w[r1 r2 r3] }

    specify "view: links" do
      expect_view(:links, format: :json).to eq([])
    end

    specify "view: items" do
      expect_view(:items, format: :json)
        .to contain_exactly(*item_names.map { |i| structured_atom_values Card[i] })
    end
  end

  describe "css" do
    let(:css) { "#box { display: block }" }

    before do
      Card.create name: "my css", content: css
    end

    it "renders CSS of items" do
      css_list = render_card(
        :content,
        { type: Card::PointerID, name: "my style list", content: "[[my css]]" },
        format: :css
      )
      #      css_list.should =~ /STYLE GROUP\: \"my style list\"/
      #      css_list.should =~ /Style Card\: \"my css\"/
      expect(css_list).to match(/#{Regexp.escape css}/)
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
card-1.100.0 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.99.6 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.99.5 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.99.4 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.99.3 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.99.2 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.99.1 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.99.0 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.98.3 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.98.2 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.98.1 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.98.0 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.97.0.1 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.97.0 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.96.8 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.96.7 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.96.6 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.96.5 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.96.4 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb
card-1.96.3 mod/pointer/spec/set/abstract/pointer/other_views_spec.rb