Permalink
Browse files

Reorganize spec

  • Loading branch information...
1 parent 5c648cb commit 5e552b7981a87a95a2866589a9dc9064cba6fc6e @sandro sandro committed Apr 3, 2012
Showing with 27 additions and 24 deletions.
  1. +27 −24 spec/respond_to_mobile_requests_spec.rb
View
51 spec/respond_to_mobile_requests_spec.rb
@@ -21,43 +21,46 @@ def session
let(:controller) { new_controller }
- it "supports a single exception" do
- controller.respond_to_mobile_requests :except => :ipad
- controller.mobylette_options[:except].should == ['ipad']
- end
-
- it "supports multiple exceptions" do
- controller.respond_to_mobile_requests :except => [:ipad, :android]
- controller.mobylette_options[:except].should == ['ipad', 'android']
- end
-
- describe "when iPad is excepted" do
-
- it "remains a mobile request" do
+ describe "#respond_to_mobile_requests" do
+ it "supports a single exception" do
controller.respond_to_mobile_requests :except => :ipad
- controller.new.send(:is_mobile_request?).should be_true
+ controller.mobylette_options[:except].should == ['ipad']
end
- it "does not respond as mobile" do
- controller.respond_to_mobile_requests :except => :ipad
- controller.new.send(:respond_as_mobile?).should be_false
+ it "supports multiple exceptions" do
+ controller.respond_to_mobile_requests :except => [:ipad, :android]
+ controller.mobylette_options[:except].should == ['ipad', 'android']
end
- end
-
- describe "when iPad and Android are excepted" do
- let(:controller) { new_controller('android') }
+ describe "when iPad is excepted" do
- context "request is Android" do
it "remains a mobile request" do
- controller.respond_to_mobile_requests :except => [:ipad, :android]
+ controller.respond_to_mobile_requests :except => :ipad
controller.new.send(:is_mobile_request?).should be_true
end
it "does not respond as mobile" do
- controller.respond_to_mobile_requests :except => [:ipad, :android]
+ controller.respond_to_mobile_requests :except => :ipad
controller.new.send(:respond_as_mobile?).should be_false
end
+
+ end
+
+ describe "when iPad and Android are excepted" do
+ let(:controller) { new_controller('android') }
+
+ context "request is Android" do
+ it "remains a mobile request" do
+ controller.respond_to_mobile_requests :except => [:ipad, :android]
+ controller.new.send(:is_mobile_request?).should be_true
+ end
+
+ it "does not respond as mobile" do
+ controller.respond_to_mobile_requests :except => [:ipad, :android]
+ controller.new.send(:respond_as_mobile?).should be_false
+ end
+ end
end
end
+
end

0 comments on commit 5e552b7

Please sign in to comment.