-
Notifications
You must be signed in to change notification settings - Fork 276
/
admin.rb
34 lines (29 loc) · 855 Bytes
/
admin.rb
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
26
27
28
29
30
31
32
33
34
Given /I am logged in/ do
# post '/admin/session', :bypass_login => '1'
visit '/admin/session'
check "Bypass credentials check"
click_on "Login with OpenID"
end
Then /a RuntimeError is thrown when I press "(.*)"/ do |button|
lambda {
click_button(button)
}.should raise_error
end
Then /^the comment exists$/ do
Comment.count.should == 2
end
Given /^the following comments? exists:$/ do |comment_table|
comment_table.hashes.each do |hash|
Factory(:comment, hash)
end
end
Given /^a comment exists with attributes:$/ do |comment_table|
comment_table.hashes.each do |hash|
Comment.find(:first, :conditions => hash).should_not be_nil
end
end
Given /^a comment does not exist with attributes:$/ do |comment_table|
comment_table.hashes.each do |hash|
Comment.find(:first, :conditions => hash).should be_nil
end
end