Sha256: a1b598bb197e1e2d23a377e72feb4daed1a62a15d33f7096eea258a73ab26dcf

Contents?: true

Size: 1.35 KB

Versions: 17

Compression:

Stored size: 1.35 KB

Contents

RSpec.shared_examples "a Betterment application" do
  context "views" do
    it "doesn't call raw" do
      result = `cd "#{Rails.root}" && find app/views | xargs ack -l "(?<![a-zA-Z_-])raw(?![a-zA-Z_-])" | sort | uniq`
      fail <<-EOF unless result.blank?
`raw` was called in the following files.
Consider rewriting to avoid using `raw` or move into a view helper.

#{result}
      EOF
    end

    it "doesn't call html_safe" do
      result = `cd "#{Rails.root}" && find app/views | xargs ack -l "(?<![a-zA-Z_-])html_safe(?![a-zA-Z_-])" | sort | uniq`
      fail <<-EOF unless result.blank?
`html_safe` was called in the following files.
Consider rewriting to avoid using `html_safe` or move into a view helper.

#{result}
      EOF
    end

    it "doesn't call safe_concat" do
      result = `cd "#{Rails.root}" && find app/views | xargs ack -l "(?<![a-zA-Z_-])safe_concat(?![a-zA-Z_-])" | sort | uniq`
      fail <<-EOF unless result.blank?
`safe_concat` was called in the following files.
Consider rewriting to avoid using `safe_concat` or move into a view helper.

#{result}
      EOF
    end

    it "doesn't use <%==" do
      result = `cd "#{Rails.root}" && find app/views | xargs ack -l "<%==" | sort | uniq`
      fail <<-EOF unless result.blank?
`<%==` was used in the following files:
Consider rewriting to avoid using `<%==`.

#{result}
      EOF
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
test_track_rails_client-2.0.0 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-1.3.0 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-1.2.0 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-1.1.0 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-1.0.0 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.20 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.19 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.18 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.17 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.16 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.15 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.14 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.13 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.12 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.11 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.10 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb
test_track_rails_client-0.9.9 vendor/gems/ruby_spec_helpers/lib/ruby_spec_helpers/shared_examples/betterment_application_examples.rb