Search Results

Search found 8 results on 1 pages for 'jspooner'.

Page 1/1 | 1 

  • Authlogic Facebook Connect and cucumber

    - by jspooner
    I added the authlogic_facebook_connect plugin to my project and I'm now having problem running my cucumber test because of a NoMethodError. undefined method `set_facebook_session' for nil:NilClass (NoMethodError) In authlogic_facebook_connect/Session.rb the method "authenticating_with_facebook_connect?" is called as some sort of callback and the controller is defined but is missing the 'set_facebook_session' method. def authenticating_with_facebook_connect? controller.set_facebook_session attempted_record.nil? && errors.empty? && controller.facebook_session end I don't understand why the cucumber test is not loading the controller with this method. I also test the app in development and cucumber environments and everything works perfect. Here is the full cucumber output. Feature: Authentication In order to keep security a user should only be able to edit their own profile Background: # features/authorization.feature:4 Given a valid user record for joe_runner # features/step_definitions/user_steps.rb:4 undefined method `set_facebook_session' for nil:NilClass (NoMethodError) ./vendor/plugins/authlogic/lib/authlogic/controller_adapters/abstract_adapter.rb:63:in `send' ./vendor/plugins/authlogic/lib/authlogic/controller_adapters/abstract_adapter.rb:63:in `method_missing' ./vendor/plugins/authlogic_facebook_connect/lib/authlogic_facebook_connect/session.rb:132:in `authenticating_with_facebook_connect?' ./vendor/plugins/authlogic/lib/authlogic/session/callbacks.rb:83:in `validate' ./vendor/plugins/authlogic/lib/authlogic/session/validation.rb:64:in `valid?' ./vendor/plugins/authlogic/lib/authlogic/session/existence.rb:65:in `save' ./vendor/plugins/authlogic/lib/authlogic/session/existence.rb:30:in `create' ./vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/session_maintenance.rb:113:in `create_session' ./vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/session_maintenance.rb:103:in `maintain_sessions' ./features/step_definitions/user_steps.rb:5:in `/^a valid user record for ([\w]*)$/' features/authorization.feature:5:in `Given a valid user record for joe_runner' Scenario: Jonathan can edit his profile but not other users profiles # features/authorization.feature:7 Given jonathan is logged in as an user # features/step_definitions/user_steps.rb:13 When I go to my user edit page # features/step_definitions/web_steps.rb:18 And I press "Update" # features/step_definitions/web_steps.rb:22 Then I should see "Account updated!" # features/step_definitions/web_steps.rb:142 When I go to joe_runner's user edit page # features/step_definitions/web_steps.rb:18 Then I should see "You do not allowed to access to view that page" # features/step_definitions/web_steps.rb:142 Failing Scenarios: cucumber features/authentication.feature:9 # Scenario: Signup cucumber features/authorization.feature:7 # Scenario: Jonathan can edit his profile but not other users profiles 2 scenarios (2 failed) 15 steps (2 failed, 13 skipped) 0m0.173s rake aborted! Command failed with status (1): [/System/Library/Frameworks/Ruby.framework/...] /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:995:in `sh' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:in `call' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:in `sh' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1094:in `sh' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1029:in `ruby' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1094:in `ruby' /Library/Ruby/Gems/1.8/gems/cucumber-0.6.4/lib/cucumber/rake/task.rb:68:in `run' /Library/Ruby/Gems/1.8/gems/cucumber-0.6.4/lib/cucumber/rake/task.rb:138:in `define_task' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:in `load' /usr/bin/rake:19 activespoon:base_project jspooner$ There are a couple of blogs that give examples on how to test facebook apps with cucumber but they didn't help because my error comes before these. http://opensoul.org/2009/3/6/testing-facebook-with-cucumber http://ryanbigg.com/2010/03/testing-facebook/

    Read the article

  • rsync does't work

    - by jspooner
    I set up a new ec2 ubuntu server and I'm unable to use rsync to push a file up. I can ssh to the machine with my keypair. I'm not sure why this looks like it works but finishes in half a second and there is nothing in /home/ubuntu on the server. ? ~ rsync -av -i ~/.ec2/my-keypair ~/Downloads/pushcom.2012-06-26T01-10-04.gz [email protected] building file list ... done >f..t.... gsg-keypair >f..t.... pushwoodcom.2012-06-26T01-10-04.gz sent 3624 bytes received 64 bytes 7376.00 bytes/sec total size is 3392 speedup is 0.92 I've tried 50 different ways of the rsync command but I can't get anything to work. Please help! Thanks

    Read the article

  • Rails routes direct index action to show action

    - by jspooner
    So I created some rspec_scaffold for an Exercise model and added "map.resource :exercises" to my routes file and I was surprised when the "/exercises" url rendered the show action. What the heck? Why doesn't that render the index action? rake routes new_exercises GET /exercises/new(.:format) {:controller=>"exercises", :action=>"new"} edit_exercises GET /exercises/edit(.:format) {:controller=>"exercises", :action=>"edit"} exercises GET /exercises(.:format) {:controller=>"exercises", :action=>"show"} PUT /exercises(.:format) {:controller=>"exercises", :action=>"update"} DELETE /exercises(.:format) {:controller=>"exercises", :action=>"destroy"} POST /exercises(.:format) {:controller=>"exercises", :action=>"create"}

    Read the article

  • grammar in views

    - by jspooner
    I'm displaying a string like "I'm an Actor" or "I'm a skateboarder" and need to use a or an correctly. Is there a nifty rails view helper to see if a word starts with a vowel? <p>I'm an <%= @user.skills %></p> <p>I'm a <%= @user.skills %></p>

    Read the article

  • ActiveRecord WHERE NOT EXISTS

    - by jspooner
    Is there a way to use EXISTS with ActiveRecord besides find_by_sql? I'd like a nice way to find all records without an association in a One-to-Many relationship. SELECT DISTINCT store_type FROM stores WHERE NOT EXISTS (SELECT * FROM cities_stores WHERE cities_stores.store_type = stores.store_type)

    Read the article

  • Overriding an ActiveRecord attribute

    - by jspooner
    I have a model with a completed:boolean column that I'd like override so I can add some conditional code. I've never override an ActiveRecord attribute before and wanted to know if the method below is good practice? class Article < ActiveRecord::Base def completed=(b) write_attribute(:completed, b) # IF b is true then do something end end

    Read the article

  • Incorrect error

    - by jspooner
    If you assign an invalid date (like December 39th) to a datetime column ActiveRecord returns a "can't be blank" error when is should probably return an error like "Not a valid date" My question. Is this expected rails behavior, a bug or, something that I could patch? class ExerciseLog < ActiveRecord::Base validates_presence_of :scheduled_datetime end Fire up the console. e = Log.new # lets set a date for Dec 39th which obviously doesn't exist e.scheduled_datetime = "2010-12-39" e.save => false # this is the confusing message since our form did post a valid date e.errors.on(:scheduled_datetime) => "can't be blank" e.scheduled_datetime = "2010-12-30" e.save => true I discovered this issue when I accidentally transposed the month and day values. btw This is in Rails 2.3.5

    Read the article

1