Sha256: a0e9747994dfe060c39bfb1e55d1676e2d3fae10de7a790c3660ba76c23401bd

Contents?: true

Size: 587 Bytes

Versions: 1

Compression:

Stored size: 587 Bytes

Contents

require 'spec_helper'

describe Erubis::OnlyRuby do
  subject {
    content =<<-EOF
    <h1>Title</h1>
    <% if current_user %>
      <%= link_to 'account', edit_user_path(current_user) %>
      <%= "Hello \#{current_user.email}" %>
    <% else %>
      Not logged in
    <% end %>
    EOF
    Erubis::OnlyRuby.new(content).src
  }

  it { should_not include('h1') }
  it { should_not include('Title') }
  it { should_not include('Not logged in') }
  it { should include('current_user') }
  it { should include('if') }
  it { should include('else') }
  it { should include('end') }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_best_practices-1.19.1 spec/rails_best_practices/core_ext/erubis_spec.rb