Sha256: dfa825dff707ecf34c560470dbd9a29882449cb64550782bc946be5ce57e1c86

Contents?: true

Size: 661 Bytes

Versions: 52

Compression:

Stored size: 661 Bytes

Contents

require 'opal'
require 'vienna'
require 'models/todo'

RSpec.configure do |config|
  config.before { Todo.reset! }
end

describe Todo do
  before do
    @task_a = Todo.create(title: 'Foo', completed: true)
    @task_b = Todo.create(title: 'Bar', completed: false)
    @task_c = Todo.create(title: 'Baz', completed: true)
    @task_d = Todo.create(title: 'Buz', completed: false)
  end

  describe '.active' do
    it "returns all non-completed todos" do
      expect(Todo.active).to eq([@task_b, @task_d])
    end
  end

  describe '.completed' do
    it "returns all completed todos" do
      expect(Todo.completed).to eq([@task_a, @task_c])
    end
  end
end

Version data entries

52 entries across 52 versions & 3 rubygems

Version Path
reactrb-0.8.8 example/todos/spec/todo_spec.rb
reactrb-0.8.7 example/todos/spec/todo_spec.rb
reactrb-0.8.6 example/todos/spec/todo_spec.rb
reactrb-0.8.5 example/todos/spec/todo_spec.rb
reactrb-0.8.4 example/todos/spec/todo_spec.rb
reactrb-0.8.3 example/todos/spec/todo_spec.rb
reactrb-0.8.1 example/todos/spec/todo_spec.rb
reactrb-0.8.0 example/todos/spec/todo_spec.rb
reactrb-0.7.42 example/todos/spec/todo_spec.rb
reactive-ruby-0.7.41 example/todos/spec/todo_spec.rb
reactive-ruby-0.7.40 example/todos/spec/todo_spec.rb
reactive-ruby-0.7.39 example/todos/spec/todo_spec.rb
reactive-ruby-0.7.38 example/todos/spec/todo_spec.rb
reactive-ruby-0.7.36 example/todos/spec/todo_spec.rb
reactive-ruby-0.7.35 example/todos/spec/todo_spec.rb
reactive-ruby-0.7.34 example/todos/spec/todo_spec.rb
reactive-ruby-0.7.33 example/todos/spec/todo_spec.rb
reactive-ruby-0.7.32 example/todos/spec/todo_spec.rb
reactive-ruby-0.7.31 example/todos/spec/todo_spec.rb
reactive-ruby-0.7.30 example/todos/spec/todo_spec.rb