public
Description: OneBody is web-based software that connects community members, especially churches, on the web.
Homepage: http://beonebody.com
Clone URL: git://github.com/seven1m/onebody.git
Started on API tests.
Tim Morgan (author)
Tue Aug 05 06:14:00 -0700 2008
commit  889b8990e925c4a39abc8ca7bee23a9c533d9a6b
tree    5066341ddbf74ce26995d6e26b79af6b7365ae74
parent  647c17b0444485e39045ee62e2ca5ea9ecfc9bea
...
89
90
91
92
 
93
94
95
...
89
90
91
 
92
93
94
95
0
@@ -89,7 +89,7 @@ class ApplicationController < ActionController::Base
0
       authenticate_with_http_basic do |email, api_key|
0
         if email.to_s.any? and api_key.to_s.length == 50
0
           Person.logged_in = @logged_in = Person.find_by_email_and_api_key(email, api_key)
0
-          Person.logged_in = @logged_in = nil unless @logged_in.super_admin?
0
+          Person.logged_in = @logged_in = nil unless @logged_in and @logged_in.super_admin?
0
         end
0
       end
0
       unless @logged_in
...
92
93
94
 
95
96
97
...
113
114
115
 
116
117
118
...
132
133
134
 
135
136
137
...
92
93
94
95
96
97
98
...
114
115
116
117
118
119
120
...
134
135
136
137
138
139
140
0
@@ -92,6 +92,7 @@ tim:
0
   visible_on_printed_directory: true
0
   full_access: true
0
   feed_code: bla
0
+  api_key: dafH2KIiAcnLEr5JxjmX2oveuczq0R6u7Ijd329DtjatgdYcKp
0
 jeremy:
0
   site_id: 1
0
   id: 2
0
@@ -113,6 +114,7 @@ jeremy:
0
   full_access: true
0
   feed_code: bla2
0
   deacon: true
0
+  api_key: dafH2KIiAcnLEr5JxjmX2oveuczq0R6u7Ijd329DtjatgdYcKq
0
 peter:
0
   site_id: 1
0
   id: 3
0
@@ -132,6 +134,7 @@ peter:
0
   visible_on_printed_directory: true
0
   full_access: true
0
   feed_code: bla3
0
+  api_key: abc # invalid key
0
 jennie:
0
   site_id: 1
0
   id: 4
...
4
5
6
 
7
8
9
...
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
...
4
5
6
7
8
9
10
...
75
76
77
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -4,6 +4,7 @@ require 'test_help'
0
 require 'notifier'
0
 
0
 require File.dirname(__FILE__) + '/forgeries'
0
+require File.dirname(__FILE__) + '/test_extensions'
0
 
0
 class Test::Unit::TestCase
0
   # Transactional fixtures accelerate your tests by wrapping each test method
0
@@ -74,16 +75,3 @@ class Test::Unit::TestCase
0
 
0
   fixtures :all
0
 end
0
-
0
-module TestExtensions
0
-  def should(name, &block)
0
-    if block_given?
0
-      define_method 'test ' + name, &block
0
-    else
0
-      puts "Unimplemented: " + name
0
-    end
0
-  end
0
-end
0
-
0
-ActionController::TestCase.extend(TestExtensions)
0
-Test::Unit::TestCase.extend(TestExtensions)

Comments