No Vanity.context (RuntimeError) in cucumber/selenium tests

162 views
Skip to first unread message

Mohith Thimmaiah

unread,
Jul 4, 2012, 10:45:24 AM7/4/12
to vanit...@googlegroups.com

I have the following cucumber test

 When /^I go to the new request page$/ do
   experiment(:request_form_type).chooses("123")
   visit  ('/user_requests/new')
 end

I preset the experiment as my test depends upon the request_form_type being 123

I see the following error

 No Vanity.context (RuntimeError)

Please advise
Regards

Mohith Thimmaiah

unread,
Jul 4, 2012, 11:32:09 AM7/4/12
to vanit...@googlegroups.com
This resolved the issue for me.

  if @current_user
    Vanity.context = Struct.new(:vanity_identity).new(@current_user.id)
  else
    Vanity.context = Struct.new(:vanity_identity).new('1')
  end
  
 
  Vanity.playground.experiment(:request_form_type).chooses("213")
Reply all
Reply to author
Forward
0 new messages