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
require File.expand_path(File.dirname(__FILE__) + "/helper")

Story "Display an article", %{
     As a user
     I want to view an article
     So that I can read its contents easily
  }, :type => RailsStory do


  Scenario "anonymous user" do

    Given "there is the following article in the system", "Article Numero Unero" do | title |
      article = Article.create(:title => title )
      @article_id = article.id
    end

    Given "this article contains a note", @article_id, "some note contents" do | article_id, note_contents |
      note = Note.create(:title => "My Note", :description => note_contents)
      ArticleSection.create( :article_id => @article_id, :content_id => note.id, :content_type => note.content_type)
    end

    Given "this article contains a link", @article_id, "http://some.domain.com" do | article_id, url |
      link = Link.create(:title => "My Link", :url => url )
      ArticleSection.create( :article_id => article_id, :content_id => link.id, :content_type => link.content_type)
    end

    Then  "we do not know yet, well just jump into debugger mode and have a look around", @article_id do | article_id |
      require "rubygems"; require "ruby-debug"; debugger 
      # The following line was added because here the debugger is the last statement and it will load with
      # out the test environment we've just created
      false
    end

  end
end

Leave a Reply