Skip to content

Commit 5e53f93

Browse files
committed
programs can be created
1 parent cdb98fc commit 5e53f93

2 files changed

Lines changed: 23 additions & 11 deletions

File tree

features/programs.feature

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
Feature: Programs
2-
Scenario: I can create new programs
3-
Given I'm logged in as "steve"
4-
When I go to the new program page
5-
And I fill in "Title" with "Hello world"
6-
And I fill in "Body" with "puts 'Hello, world!'"
7-
And I press "Create"
8-
Then I should be on the "steve/hello_world" program page.
9-
And I should see "Program created"
10-
And I should see "Hello world"
11-
And I should see "By steve"
12-
And I should see "puts"
132
Scenario: See programs on my page
143
Given I'm logged in as "steve"
154
And I have some programs

spec/acceptance/programs_spec.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require File.dirname(__FILE__) + '/acceptance_helper'
2+
3+
feature "Programs" do
4+
5+
scenario "can be created" do
6+
@hacker = Factory(:hacker)
7+
log_in @hacker
8+
9+
visit "/programs/new"
10+
fill_in "Title", :with => "Hello world"
11+
fill_in "Body", :with => "puts 'Hello, world!'"
12+
click_button "Create"
13+
14+
should_be_on "#{@hacker.username}/hello_world"
15+
16+
page.should have_content "Program created"
17+
page.should have_content "Hello world"
18+
page.should have_content "By steve"
19+
page.should have_content "puts"
20+
21+
end
22+
23+
end

0 commit comments

Comments
 (0)