Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Adding jslint testing and reenabling javascript default confi…

…guration specs"

This reverts commit 1fea1bf.
  • Loading branch information...
commit 919a79fe5c3c0affbf9487cf31bc2d1c33c66a63 1 parent f44b4ab
@mmangino mmangino authored
Showing with 29 additions and 63 deletions.
  1. +0 −1  Gemfile
  2. +0 −16 spec/be_lintable.rb
  3. +29 −46 spec/helpers/javascript_spec.rb
View
1  Gemfile
@@ -2,4 +2,3 @@ source "http://rubygems.org"
source :gemcutter
gemspec
-gem "jslint_on_rails"
View
16 spec/be_lintable.rb
@@ -1,16 +0,0 @@
-require 'spec_helper'
-require 'jslint_on_rails'
-
-def be_lintable
- ::Spec::Matchers::Matcher.new :be_lintable do
- match do |actual|
- tmp_js_output = Tempfile.new 'output.js'
- tmp_js_output.puts(actual)
- lint = JSLint::Lint.new(
- :paths => [tmp_js_output.path]
- )
- lint.run
- true
- end
- end
-end
View
75 spec/helpers/javascript_spec.rb
@@ -3,43 +3,31 @@
include Facebooker2::Rails::Helpers
include Facebooker2
describe "fb_connect_async_js" do
- context "loading with defaults" do
- it "specifies correct appId" do
- js = fb_connect_async_js '12345'
- js.include?("appId : '12345',").should be_true, js
- end
- it "enables status" do
- js = fb_connect_async_js '12345'
- js.include?("status : true,").should be_true, js
- end
- it "enables cookies" do
- js = fb_connect_async_js '12345'
- js.include?("cookie : true,").should be_true, js
- end
- it "enables xfbml" do
- js = fb_connect_async_js '12345'
- js.include?("xfbml : true").should be_true, js
- end
- it "does not specify a channelUrl" do
- js = fb_connect_async_js '12345'
- js.include?("channelUrl").should be_false, js
- end
- it "does not specify oauth2" do
- js = fb_connect_async_js '12345'
- js.include?("oauth2").should be_false, js
- end
- it "does select en_US" do
- js = fb_connect_async_js '12345'
- js.include?("en_US").should be_true, js
- end
-
- it "should be properly formed" do
- js = fb_connect_async_js '12345'
- js.should be_lintable
- end
- end
-
-
+ #it "loads with defaults" do
+ # js = fb_connect_async_js '12345'
+ # js.should == <<-JAVASCRIPT
+ # <div id="fb-root"></div>
+ # <script>
+ # window.fbAsyncInit = function() {
+ # FB.init({
+ # appId : '12345',
+ # status : true, // check login status
+ # cookie : true, // enable cookies to allow the server to access the session
+ #
+ # xfbml : true // parse XFBML
+ # });
+ #
+ # };
+ #
+ # (function() {
+ # var e = document.createElement('script'); e.async = true;
+ # e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
+ # document.getElementById('fb-root').appendChild(e);
+ # }());
+ # </script>
+ # JAVASCRIPT
+ #end
+
it "disables cookies" do
js = fb_connect_async_js '12345', :cookie => false
js.include?("cookie : false").should be_true, js
@@ -65,15 +53,10 @@
js.include?("//connect.facebook.net/fr_FR/all.js").should be_true, js
end
- context "Oauth2" do
- after(:all) do
- Facebooker2.oauth2=false
- end
- it "enables oauth" do
- Facebooker2.oauth2=true
- js = fb_connect_async_js '12345'
- js.include?("oauth").should be_true, js
- end
+ it "supports oauth" do
+ Facebooker2.oauth2=true
+ js = fb_connect_async_js '12345'
+ js.include?("oauth").should be_true, js
end
# Can't get this to work!
Please sign in to comment.
Something went wrong with that request. Please try again.