Skip to content

Instantly share code, notes, and snippets.

@mfebrianto
Created August 17, 2014 12:26
Show Gist options
  • Save mfebrianto/d25f114ce2ceebe5c84f to your computer and use it in GitHub Desktop.
Save mfebrianto/d25f114ce2ceebe5c84f to your computer and use it in GitHub Desktop.
# location of this file : required_field_style/spec/required_field_style_spec.rb
require 'spec_helper'
module RequiredFieldStyle
describe '/accounts/new.html.erb', :type => :view do
it 'should render mandatory style for required field' do
required_field = 'Account no'
mandatory_style = '<sup style=\"color:red\">&nbsp;*</sup>'
assigns[:account] = Account.new
render
response.body.to_s =~ /#{required_field}#{mandatory_style}/
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment