Query request query 401 query results are not allowed for omniauth-facebook & devise

I am working on a Facebook application and use devess and omniauth-facebook for authentication. I followed the wiki pages to set it up, and also used OmniAuth.config.add_mock (: facebook, @omniauth_hash) for my specs.

This is my gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.3'
gem 'sqlite3', '~> 1.3.6'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'devise', '~> 2.0.4'
gem 'haml', '~> 3.1.4'
gem 'haml-rails', '~> 0.3.4'
gem 'therubyracer', '~> 0.9.10'
gem 'twitter-bootstrap-rails', '~> 2.0.6'
gem 'simple_form', '~> 2.0.2'
gem 'omniauth-facebook', '~> 1.2.0'
gem 'unicorn', '~> 4.3.1'
gem 'koala', '~> 1.4.1'
gem "formtastic", "~> 2.1.1" # 2.2.0 breaks activeadmin 0.4.3
gem 'activeadmin', '~> 0.4.3'
gem 'redis', '~> 2.2.2'

gem 'jquery-rails', '~> 2.0.2'

group :development, :test do
  gem 'spork', '~> 1.0rc'
  gem 'guard'
  gem 'guard-test'                            # run tests automatically in background
  gem 'annotate', '2.4.1.beta1'
  gem 'guard-annotate'                        # annotate models, tests, etc with infos from db
  gem 'guard-rspec'                           # run specs automatically in background
  gem 'guard-spork', '~> 0.5.2'
  gem 'rb-fsevent'
  gem 'growl'
  gem 'rspec-core',  '2.7.0'
  gem 'rspec-rails', '2.7.0'
  gem 'simplecov'                             # test coverage
  gem 'factory_girl', '2.3.2', :require => false
  gem 'factory_girl_rails', '~> 1.4', :require => false                    # better fixtures
  gem 'capybara'                              # better request tests with rspec
  gem 'capybara-json', '~> 0.2.0'
  gem 'launchy'
end

My GET request specifications work fine. Redirect to omniauth callback, etc. Now I wanted to test my first POST request, which I use as the backend api for the flash client. In my spec requests, I just get the “401 Unauthorized” message when this mail request is called.

Can anyone help me out? Did I forget something? Why are my GET requests working fine but POST is not working?

Thanks in advance

+3

All Articles