aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/admin_user_controller_spec.rb
blob: 313f3f3289dbedee2dc12967ef9ccddcfb6f6cf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe AdminUserController, "when administering users" do
    integrate_views
    fixtures :users
    before { basic_auth_login @request }
  
    it "shows the index/list page" do
        get :index
    end

    it "searches for 'bob'" do
        get :list, :query => "bob"
        assigns[:admin_users].should == [ users(:bob_smith_user) ]
    end

    it "shows a user" do
        get :show, :id => users(:bob_smith_user)
    end

end
class="w"> f.each_line do |line| line.force_encoding('ASCII-8BIT') if RUBY_VERSION.to_f >= 1.9 if request_match = line.match(/^Started (GET|OPTIONS|POST) "(\/request\/.*?)"/) next if line.match(/request\/\d+\/response/) urls[request_match[2]] += 1 processed += 1 end end url_counts = urls.to_a num_requests_visited_n_times = Hash.new(0) CSV.open(output_file_path, "wb") do |csv| csv << ['URL', 'Number of visits'] url_counts.sort_by(&:last).each do |url, count| num_requests_visited_n_times[count] +=1 csv << [url,"#{count}"] end csv << ['Number of visits', 'Number of URLs'] num_requests_visited_n_times.to_a.sort.each do |number_of_times, number_of_requests| csv << [number_of_times, number_of_requests] end csv << ['Total number of visits'] csv << [processed] end end end