summaryrefslogtreecommitdiffstats
path: root/tests/acceptance/features/step_definitions/basic_steps.rb
blob: f62fdf9c77bb7cd6ab1a59f8f03b3950775396e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Given (/^I am logged in$/) do

  # be sure to use the right browser session
  Capybara.session_name = 'test'

  # logout - just to be sure
  visit '/index.php?logout=true'
  visit '/'
  fill_in 'user', with: 'test'
  fill_in 'password', with: "test"
  click_button 'submit'

  # if visibility is not set to false it will fail
  page.should have_selector('a#logout', :visible => false)
end

Given (/^I am in the "([^"]+)" app$/) do |app|
  visit "/index.php/apps/#{app}/"
  page.should have_selector('a#logout', :visible => false)
end

When (/^I go to "([^"]+)"$/) do |path|
  visit "#{path}"
  page.should have_selector('a#logout', :visible => false)
end