Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add rails-integration-test-minor-mode, and fix form_for snippet.

  • Loading branch information...
commit b5cb3e20560511e2b98563a3ea2a42473aeed7ad 1 parent ac1df06
crazycode authored January 13, 2009
37  rails-integration-test-minor-mode.el
... ...
@@ -0,0 +1,37 @@
  1
+;;; rails-integration-test-minor-mode.el --- minor mode for RubyOnRails integration tests
  2
+
  3
+;; Copyright (C) 2006 Dmitry Galinsky <dima dot exe at gmail dot com>
  4
+
  5
+;; Authors: Dmitry Galinsky <dima dot exe at gmail dot com>
  6
+
  7
+;; Keywords: ruby rails languages oop
  8
+;; $URL$
  9
+;; $Id$
  10
+
  11
+;;; License
  12
+
  13
+;; This program is free software; you can redistribute it and/or
  14
+;; modify it under the terms of the GNU General Public License
  15
+;; as published by the Free Software Foundation; either version 2
  16
+;; of the License, or (at your option) any later version.
  17
+
  18
+;; This program is distributed in the hope that it will be useful,
  19
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  20
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21
+;; GNU General Public License for more details.
  22
+
  23
+;; You should have received a copy of the GNU General Public License
  24
+;; along with this program; if not, write to the Free Software
  25
+;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  26
+
  27
+;;; Code:
  28
+
  29
+(define-minor-mode rails-integration-test-minor-mode
  30
+  "Minor mode for RubyOnRails integration tests."
  31
+  :lighter " ITest"
  32
+  :keymap (let ((map (rails-controller-layout:keymap :integration-test)))
  33
+            (define-key map rails-minor-mode-test-current-method-key 'rails-test:run-current-method)
  34
+            (define-key map [menu-bar rails-controller-layout run] '("Test current method" . rails-test:run-current-method))
  35
+            map))
  36
+
  37
+(provide 'rails-integration-test-minor-mode)
9  rails-snippets-feature.el
@@ -158,7 +158,7 @@
158 158
        ("head" "<head>\n$><meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\"/>\n$><title>$${title}</title>\n$>$.\n</head>" "head")
159 159
        ("h" "<h1 id=\"$${alpha}\">$${paste}</h1>" "heading")
160 160
        ("ft" "<%= form_tag :action => \"$${update}\" %>\n$.\n<%= end_form_tag %>" "form_tag")
161  
-       ("ff" "<%= form_for :$${item}, :action => \"$${update}\" %>\n$.\n<% end %>" "form_for")
  161
+       ("ff" "<% form_for :$${item}, :action => \"$${update}\" do |f| -%>\n$.\n<% end -%>" "form_for")
162 162
        ("form" "<form action=\"$${action}\" method=\"$${post}\" accept-charset=\"utf-8\">\n$>$.\n\n$><p><input type=\"submit\" value=\"Continue &rarr;\"/></p>\n</form>" "form")
163 163
        ("dtht" "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n$>\"http://www.w3.org/TR/html4/strict.dtd\">\n" "HTML -- 4.01 Strict")
164 164
        ("dchttr" "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n$>\"http://www.w3.org/TR/html4/loose.dtd\">\n" "HTML -- 4.01 Transitional")
@@ -186,6 +186,7 @@
186 186
        rails-view-minor-mode-abbrev-table
187 187
        rails-helper-minor-mode-abbrev-table
188 188
        rails-functional-test-minor-mode-abbrev-table
  189
+       rails-integration-test-minor-mode-abbrev-table
189 190
        ("rest" "respond_to do |format|\n$>format.html$>$.\nend$>" "respond_to ..." rails-controller-minor-mode-abbrev-table)
190 191
        ("rindex" "$${,rails-snippets-feature:rest-index}" "models_url")
191 192
        ("rshow" "$${,rails-snippets-feature:rest-show}" "model_url(@model)")
@@ -266,9 +267,9 @@
266 267
        ("par" "params[:$${id}]" "params[...]")
267 268
        ("session" "session[:$${User}]" "session[...]")
268 269
        ("flash" "flash[:$${notice}] = '$${Successfully}'$." "flash[...]")) ; environment
269  
-    (0 "tests" rails-functional-test-minor-mode-abbrev-table rails-unit-test-minor-mode-abbrev-table
  270
+    (0 "tests" rails-functional-test-minor-mode-abbrev-table rails-unit-test-minor-mode-abbrev-table rails-integration-test-minor-mode-abbrev-table
270 271
        ("fix" "$${,rails-snippets-feature:fixture}(:$${one})$." "models(:name)")) ; functional tests
271  
-    (0 "shoulda" rails-functional-test-minor-mode-abbrev-table rails-unit-test-minor-mode-abbrev-table
  272
+    (0 "shoulda" rails-functional-test-minor-mode-abbrev-table rails-unit-test-minor-mode-abbrev-table rails-integration-test-minor-mode-abbrev-table
272 273
        ("cont" "context \"$${description}\" do\n$>setup do\n$>$${setup}\nend$>\n\n$>should$.\nend$>" "context block with setup")
273 274
        ("should" "should \"$${description}\" do\n$>$.\nend$>" "should block")
274 275
        ("shoulds" "should \"$${description}\" do\n$>flunk\nend$>\n\n$>shoulds$." "several should blocks")
@@ -295,7 +296,7 @@
295 296
        ("srua" "should_require_unique_attributes :$${attribute}" "should_require_unique_attributes")
296 297
        ("srw" "should_respond_with :$${response}" "should_respond_with")
297 298
        ("sstft" "should_set_the_flash_to $${value}" "should_set_the_flash_to")) ; shoulda tests
298  
-    (0 "assertions" rails-functional-test-minor-mode-abbrev-table rails-unit-test-minor-mode-abbrev-table
  299
+    (0 "assertions" rails-functional-test-minor-mode-abbrev-table rails-unit-test-minor-mode-abbrev-table rails-integration-test-minor-mode-abbrev-table
299 300
        ("art" "assert_redirected_to :action => '$${index}'" "assert_redirected_to")
300 301
        ("as" "assert $${test}" "assert(...)")
301 302
        ("asa" "assert assigns(:$${,rails-snippets-feature:model-name})" "assert assigns(...)")
1  rails.el
@@ -178,6 +178,7 @@ Emacs w3m browser."
178 178
     (:plugin           "vendor/plugins/")
179 179
     (:unit-test        "test/unit/")
180 180
     (:functional-test  "test/functional/")
  181
+    (:integration-test  "test/integration/")
181 182
     (:fixture          "test/fixtures/")
182 183
     (:lib              "lib")
183 184
     (:rspec-controller "spec/controllers")

0 notes on commit b5cb3e2

Please sign in to comment.
Something went wrong with that request. Please try again.