This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
def test | |
2 + 2 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "Search courses" do | |
it "by topic" do | |
create_course_catalog | |
create_biology_courses("A001", "B205") | |
search_for('biology') | |
page.should have_content "A001" | |
page.should have_content "B205" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "Search courses" do | |
it "by topic" do | |
240.times { Course.create! } | |
Course.create!(topic: "biology", name: "A001") | |
Course.create!(topic: "biology", name: "B205") | |
visit search_path | |
fill_in "Search", with: "biology" | |
click_button "Search" | |
page.should have_content "A001" | |
page.should have_content "B205" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fill_in "Username", with: "test_user" | |
fill_in "Password", with: "secret" | |
click_button "Login" | |
page.should have_content "Signed in!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given /there are (.*) courses which do not have the topic \"(.*)\"/ do |number, topic| | |
number.times { |n| Course.create!(topic: 'something else' } | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Search courses | |
In order to ensure better utilization of courses | |
Potential students should be able to search for courses | |
Scenario: Search by topic | |
Given there are 240 courses which do not have the topic "biology" | |
And there are 2 courses A001, B205 that each have "biology" as one of the topics | |
When I search for "biology" | |
Then I should see the following courses: | |
| Course code | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/db/schema.rb b/db/schema.rb | |
index 609c0a0..d37e32d 100644 | |
--- a/db/schema.rb | |
+++ b/db/schema.rb | |
@@ -97,18 +97,18 @@ ActiveRecord::Schema.define(:version => 20120614194043) do | |
t.date "due" | |
t.text "notes" | |
t.integer "customer_id" | |
- t.datetime "created_at", :null => false | |
- t.datetime "updated_at", :null => false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
state :sleeping do | |
def hungry? | |
false | |
end | |
end | |
state all - [:sleeping] do | |
def hungry? | |
true | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> gonzo.wake_up | |
=> true | |
> gonzo.walk | |
=> true | |
> gonzo.state | |
=> "walking" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> gonzo.can_walk? | |
=> false | |
> gonzo.walk | |
=> false | |
> gonzo.state | |
=> "sleeping" |