Sha256: b53974aeed1d7930a6335e9f2b0192aea3ccdef7cf1783a9c779fa1450977f24

Contents?: true

Size: 1.17 KB

Versions: 17

Compression:

Stored size: 1.17 KB

Contents

RSpec.shared_context 'seeds' do
  before do
    jane_id = conn[:users].insert name: 'Jane'
    joe_id = conn[:users].insert name: 'Joe'

    conn[:tasks].insert user_id: joe_id, title: 'Joe Task'
    task_id = conn[:tasks].insert user_id: jane_id, title: 'Jane Task'

    conn[:tags].insert task_id: task_id, name: 'red'

    jane_post_id = conn[:posts].insert author_id: jane_id, title: 'Hello From Jane', body: 'Jane Post'
    joe_post_id = conn[:posts].insert author_id: joe_id, title: 'Hello From Joe', body: 'Joe Post'

    red_id = conn[:labels].insert name: 'red'
    green_id = conn[:labels].insert name: 'green'
    blue_id = conn[:labels].insert name: 'blue'

    conn[:posts_labels].insert post_id: jane_post_id, label_id: red_id
    conn[:posts_labels].insert post_id: jane_post_id, label_id: blue_id

    conn[:posts_labels].insert post_id: joe_post_id, label_id: green_id

    conn[:messages].insert author: 'Jane', body: 'Hello folks'
    conn[:messages].insert author: 'Joe', body: 'Hello Jane'

    conn[:reactions].insert message_id: 1, author: 'Joe'
    conn[:reactions].insert message_id: 1, author: 'Anonymous'
    conn[:reactions].insert message_id: 2, author: 'Jane'
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rom-repository-1.4.0 spec/shared/seeds.rb
rom-repository-1.3.3 spec/shared/seeds.rb
rom-repository-1.3.2 spec/shared/seeds.rb
rom-repository-1.3.1 spec/shared/seeds.rb
rom-repository-1.3.0 spec/shared/seeds.rb
rom-repository-1.2.0 spec/shared/seeds.rb
rom-repository-1.1.0 spec/shared/seeds.rb
rom-repository-1.0.2 spec/shared/seeds.rb
rom-repository-1.0.1 spec/shared/seeds.rb
rom-repository-1.0.0 spec/shared/seeds.rb
rom-repository-1.0.0.rc2 spec/shared/seeds.rb
rom-repository-1.0.0.rc1 spec/shared/seeds.rb
rom-repository-1.0.0.beta3 spec/shared/seeds.rb
rom-repository-1.0.0.beta2 spec/shared/seeds.rb
rom-repository-1.0.0.beta1 spec/shared/seeds.rb
rom-repository-0.3.1 spec/shared/seeds.rb
rom-repository-0.3.0 spec/shared/seeds.rb