File: rails.rb

package info (click to toggle)
ruby-http-accept-language 2.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 140 kB
  • sloc: ruby: 363; makefile: 3
file content (37 lines) | stat: -rw-r--r-- 896 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Before "@rails" do
  @rails = RailsDriver.new
end

When /^I generate a new Rails app$/ do
  @rails.generate_rails
end

When /^I add http_accept_language to my Gemfile$/ do
  @rails.append_gemfile
end

Given /^I have installed http_accept_language$/ do
  @rails.install_gem
end

When /^I generate the following controller:$/ do |string|
  @rails.generate_controller "languages", string
end

When /^I access that action with the HTTP_ACCEPT_LANGUAGE header "(.*?)"$/ do |header|
  @rails.with_rails_running do
    @rails.request_with_http_accept_language_header(header, "/languages")
  end
end

Then /^the response should contain "(.*?)"$/ do |output|
  @rails.output_should_contain(output)
end

When /^I run `rake middleware`$/ do
  @rails.bundle_exec("rake middleware")
end

Then /^the output should contain "(.*?)"$/ do |expected|
  @rails.assert_partial_output(expected, @rails.all_output)
end