Last active
January 1, 2016 20:29
-
-
Save cosmo0920/8197060 to your computer and use it in GitHub Desktop.
waku work controller spec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/server/spec/app/controllers/action_controller_spec.rb b/server/spec/app/controllers/action_controller_spec.rb | |
new file mode 100644 | |
index 0000000..75ebee7 | |
--- /dev/null | |
+++ b/server/spec/app/controllers/action_controller_spec.rb | |
@@ -0,0 +1,12 @@ | |
+require 'spec_helper' | |
+ | |
+describe "ActionController" do | |
+ context "when not login" do | |
+ let (:redirect) { 403 } | |
+ before do | |
+ get :work | |
+ end | |
+ | |
+ it { last_response.status.should eq redirect } | |
+ end | |
+end | |
diff --git a/server/spec/app/controllers/base_controller_spec.rb b/server/spec/app/controllers/base_controller_spec.rb | |
index d63925d..26f5bd1 100644 | |
--- a/server/spec/app/controllers/base_controller_spec.rb | |
+++ b/server/spec/app/controllers/base_controller_spec.rb | |
@@ -1,7 +1,19 @@ | |
require 'spec_helper' | |
describe "BaseController" do | |
- before do | |
- get "/" | |
+ context "get /" do | |
+ before do | |
+ get "/" | |
+ end | |
+ | |
+ it { last_response.status.should be_true } | |
+ end | |
+ | |
+ context "get /mypage" do | |
+ before do | |
+ get "/mypage" | |
+ end | |
+ | |
+ it { last_response.status.should be_true } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment