Topic: cucumber testing cant access private pages [Solved]

i am trying to write application and have BDT

i am trying to make sure that a random visitor to the site cant go in to a private section.

my test
features/visitor_views_site_features.feature

Scenario Outline: Visit private pages and i am not registered to the site-
When I go to a private page <Page>
Then I should see "Welcome to Dev Site"
Examples: List of private pages
| Page |
| Private Page |

"features/step_definitions/visitor_views_site_features.rb"

When /^I go to a private page Private Page$/ do
  visit privatepage_path
end

putout

| Private Page |
      PG::Error: ERROR:  relation "users" does not exist
      LINE 4:              WHERE a.attrelid = '"users"'::regclass
                                              ^
      :             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
                    FROM pg_attribute a LEFT JOIN pg_attrdef d
                      ON a.attrelid = d.adrelid AND a.attnum = d.adnum
                   WHERE a.attrelid = '"users"'::regclass
                     AND a.attnum > 0 AND NOT a.attisdropped
                   ORDER BY a.attnum
       (ActiveRecord::StatementInvalid)
      ./app/controllers/devise_controller.rb:94:in `new'
      ./app/controllers/devise_controller.rb:94:in `build_resource'
      ./app/controllers/devise/sessions_controller.rb:7:in `new'
      ./features/step_definitions/visitor_views_site_features.rb:51:in `/^I go to a private page Private Page$/'
      features/visitor_views_site_features.feature:18:in `When I go to a private page <Page>'

Last edited by moiseszaragoza (2012-06-13 15:59:04)

Re: cucumber testing cant access private pages [Solved]

make sure that you TEST DB is set

rake db:test:clone