Sha256: e259d568b287068937b9a67a2d11fb31a3ebf96dd70e8a2b92d99422a3750616

Contents?: true

Size: 1020 Bytes

Versions: 3

Compression:

Stored size: 1020 Bytes

Contents

require 'rails_helper'

describe 'Samples', type: :request do
  before :each do
    get '/samples/index'
  end

  it 'not html_safe string, keep it' do
    expect(response.body).not_to have_tag('li.case1 xmp')
  end

  it 'alter with not string' do
    expect(response.body).to have_tag('li.case2', text: 'string')
  end

  it 'alter with not html_safe string' do
    expect(response.body).not_to have_tag('li.case3 xmp')
  end

  it 'alter with html_safe string' do
    expect(response.body).to have_tag('li.case4 strong')
  end

  it 'alter with named anchor' do
    expect(response.body).to have_tag('li.case7', text: 'Thank you', count: 1)
  end

  it 'alter with same named anchor' do
    expect(response.body).to have_tag('li', text: 'Multiple altering', count: 2)
  end

  it 'ignore anchor name not exist' do
    expect(response.body).not_to include('Not exist')
  end

  it 'SafeBuffer can concatenate after altering' do
    expect(response.body).to have_tag('footer', text: 'Concatenated', count: 1)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kaizan-0.0.3 spec/requests/samples_request_spec.rb
kaizan-0.0.2 spec/requests/samples_request_spec.rb
kaizan-0.0.1 spec/requests/samples_request_spec.rb