Module: GlobalHelpers
- Defined in:
- lib/testing/helpers/global_helpers.rb
Instance Method Summary collapse
Instance Method Details
#account ⇒ Object
10 11 12 |
# File 'lib/testing/helpers/global_helpers.rb', line 10 def account Account.first || raise("Could not find a site. Maybe you want to set one up in your story background?") end |
#parsed_html ⇒ Object
14 15 16 17 18 19 |
# File 'lib/testing/helpers/global_helpers.rb', line 14 def parsed_html # memoizing this causes problems since it seems to be memoized across requests # TODO: Figure out way to memoize within one request only # @parsed_body ||= Nokogiri::HTML(response.body) Nokogiri::HTML(response.body) end |
#site ⇒ Object
2 3 4 |
# File 'lib/testing/helpers/global_helpers.rb', line 2 def site Site.first || raise("Could not find a site. Maybe you want to set one up in your story background?") end |
#user ⇒ Object
6 7 8 |
# File 'lib/testing/helpers/global_helpers.rb', line 6 def user @user || raise("@current_user is not set. Maybe you want to sign in first?") end |