-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsong_steps.rb
48 lines (36 loc) · 1.12 KB
/
song_steps.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
35
36
37
38
39
40
41
42
43
44
45
46
47
def enter_song song
fill_in "song[artist]", :with => song[:artist]
fill_in "song[name]", :with => song[:name]
fill_in "song[gener]", :with => song[:gener]
page.should have_button("Create Song")
end
Given /^I am on page newsong$/ do
visit '/songs/new'
end
When /^I am entering valide song$/ do
enter_song FactoryGirl.build(:song)
click_button "Create Song"
end
Then /^I see a message song added to list$/ do
page.should have_content("Song was successfully created")
end
Then /^I am entering invalide song$/ do
enter_song FactoryGirl.build(:invalide_song)
click_button "Create Song"
end
Then /^I am not entering song "(.*?)"$/ do |arg|
enter_song FactoryGirl.build(:song ,arg=>nil)
# click_button "Create Song"
end
Then /^I see a message song is not valid$/ do
page.should have_content("Name is too long")
end
Then /^I Press "(.*?)" Button$/ do |arg|
click_button(arg)
end
Then /^I see a message First name should not be blank$/ do
page.should have_content("Name First name should not be blank")
end
Then /^I am entering song "(.*?)" as "(.*?)"$/ do |arg,arg2|
enter_song FactoryGirl.build(:song ,arg=>arg2)
end