Sha256: 0c7f30a2740eace41c3ede21d30d43050af68a0e622e9652ae80edfb98c74d51

Contents?: true

Size: 1.26 KB

Versions: 7

Compression:

Stored size: 1.26 KB

Contents

require 'spec_helper'

class FilesController < ApplicationController
  def index
  end
end

describe FilesController, type: :controller do
  render_views

  before :all do
    Footnotes.enabled = true
  end

  after :all do
    Footnotes.enabled = false
  end

  it 'includes stylesheets assets in the response' do
    get :index
    expect(response.body).to include("FILES INDEX")
    js_debug = first('fieldset#javascripts_debug_info div', visible: false)
    expect(js_debug).to have_selector('li a', visible: false, count: 1)
    expect(js_debug).to have_selector('li a', text: /foobar\.js/, visible: false)
    link = js_debug.first('a', visible: false)
    expect(link['href']).to eq("txmt://open?url=file://#{Rails.root.join('app', 'assets', 'javascripts', 'foobar.js')}&line=1&column=1")
  end

  it 'includes css assets in the response' do
    get :index
    css_debug = first('fieldset#stylesheets_debug_info div', visible: false)
    expect(css_debug).to have_selector('li a', visible: false, count: 1)
    expect(css_debug).to have_selector('li a', text: /foobar\.css/, visible: false)
    link = css_debug.first('a', visible: false)
    expect(link['href']).to eq("txmt://open?url=file://#{Rails.root.join('app', 'assets', 'stylesheets', 'foobar.css')}&line=1&column=1")
  end

end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
rails-footnotes-7.1.0 spec/controllers/files_note_controller_spec.rb
rails-footnotes-7.0.1 spec/controllers/files_note_controller_spec.rb
rails-footnotes-7.0.0 spec/controllers/files_note_controller_spec.rb
rails-footnotes-5.0.0 spec/controllers/files_note_controller_spec.rb
rails6-footnotes-5.0.2 spec/controllers/files_note_controller_spec.rb
rails6-footnotes-5.0.1 spec/controllers/files_note_controller_spec.rb
rails6-footnotes-5.0.0 spec/controllers/files_note_controller_spec.rb