Sha256: d5238ca8250a0f7b2dc891f134e3a6401631b2d2d72a10ee93daa9344461fc47

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

require 'jldrill/spec/StoryMemento'
require 'jldrill/spec/SampleQuiz'
require 'jldrill/views/test/CommandView'
require 'jldrill/views/test/ProblemView'
require 'jldrill/views/test/QuizStatusView'
require 'jldrill/views/test/VocabularyTableView'
require 'jldrill/views/test/ItemHintView'

module JLDrill::BrowseItems

    Story = JLDrill::StoryMemento.new("Browse Items")
    def Story.setup(type)
        super(type)
        @context = @mainContext.showAllVocabularyContext
        @view = @context.peekAtView
    end
    def Story.start
        super
        @mainContext.quiz = JLDrill::SampleQuiz.new.quiz
        @mainContext.quiz.resetContents
    end
    def Story.quiz
        @mainContext.quiz
    end

    describe Story.stepName("Edit an item from the vocabulary list") do
        before(:each) do
            Story.setup(JLDrill::Test)
            Story.start
        end

        after(:each) do
            Story.shutdown
        end

        it "should be display all the vocabulary" do
            Story.view.should_receive(:update)
            Story.mainContext.showAllVocabulary
        end

        it "should be able to edit one of the items" do
            Story.mainContext.showAllVocabulary
            Story.view.items.should_not be_nil
            item = Story.view.items[0]
            item.should_not be_nil
            Story.mainContext.should_receive(:editItem).with(item)
            Story.context.edit(item)
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jldrill-0.5.1.7 spec/jldrill/stories/UserBrowsesItems_story.rb