OSDN Git Service

add HelpController
authorokimoto <okimoto@good-day.co.jp>
Wed, 16 Dec 2009 10:35:52 +0000 (19:35 +0900)
committerokimoto <okimoto@good-day.co.jp>
Wed, 16 Dec 2009 10:35:52 +0000 (19:35 +0900)
app/controllers/help_controller.rb [new file with mode: 0644]
app/helpers/help_helper.rb [new file with mode: 0644]
app/views/help/index.html.erb [new file with mode: 0644]
spec/controllers/help_controller_spec.rb [new file with mode: 0644]
spec/helpers/help_helper_spec.rb [new file with mode: 0644]
spec/views/help/index.html.erb_spec.rb [new file with mode: 0644]

diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb
new file mode 100644 (file)
index 0000000..774906b
--- /dev/null
@@ -0,0 +1,8 @@
+class HelpController < ApplicationController
+
+  # GET /help
+  def index
+    # nop
+  end
+
+end
diff --git a/app/helpers/help_helper.rb b/app/helpers/help_helper.rb
new file mode 100644 (file)
index 0000000..6a35490
--- /dev/null
@@ -0,0 +1,2 @@
+module HelpHelper
+end
diff --git a/app/views/help/index.html.erb b/app/views/help/index.html.erb
new file mode 100644 (file)
index 0000000..d4f1e5c
--- /dev/null
@@ -0,0 +1,4 @@
+<%- @title = 'Help' -%>
+
+<h1><%=h @title %></h1>
+
diff --git a/spec/controllers/help_controller_spec.rb b/spec/controllers/help_controller_spec.rb
new file mode 100644 (file)
index 0000000..abebb04
--- /dev/null
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe HelpController do
+
+  #Delete these examples and add some real ones
+  it "should use HelpController" do
+    controller.should be_an_instance_of(HelpController)
+  end
+
+
+  describe "GET 'index'" do
+    it "should be successful" do
+      get 'index'
+      response.should be_success
+    end
+  end
+end
diff --git a/spec/helpers/help_helper_spec.rb b/spec/helpers/help_helper_spec.rb
new file mode 100644 (file)
index 0000000..ebc9213
--- /dev/null
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe HelpHelper do
+
+  #Delete this example and add some real ones or delete this file
+  it "should be included in the object returned by #helper" do
+    included_modules = (class << helper; self; end).send :included_modules
+    included_modules.should include(HelpHelper)
+  end
+
+end
diff --git a/spec/views/help/index.html.erb_spec.rb b/spec/views/help/index.html.erb_spec.rb
new file mode 100644 (file)
index 0000000..f92bba7
--- /dev/null
@@ -0,0 +1,12 @@
+require 'spec_helper'
+
+describe "/help/index" do
+  before(:each) do
+    render 'help/index'
+  end
+
+  #Delete this example and add some real ones or delete this file
+  it "should tell you where to find the file" do
+    response.should have_tag('p', %r[Find me in app/views/help/index])
+  end
+end