Sha256: 1effdd2e235c21fbff9d0d0045c0a66373cb323b52b93ea1bf4a242ed498edeb

Contents?: true

Size: 599 Bytes

Versions: 14

Compression:

Stored size: 599 Bytes

Contents

RSpec.shared_context 'posts' do
  before do
    inferrable_relations.concat %i(posts)
  end

  before do |example|
    conn.create_table :posts do
      primary_key :post_id
      foreign_key :author_id, :users
      String :title
      String :body
    end
  end

  before do |example|
    next if example.metadata[:seeds] == false

    conn[:posts].insert(
      post_id: 1,
      author_id: 2,
      title: "Joe's post",
      body: 'Joe wrote sutin'
    )

    conn[:posts].insert(
      post_id: 2,
      author_id: 1,
      title: "Jane's post",
      body: 'Jane wrote sutin'
    )
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rom-sql-1.3.5 spec/shared/posts.rb
rom-sql-1.3.4 spec/shared/posts.rb
rom-sql-1.3.3 spec/shared/posts.rb
rom-sql-1.3.2 spec/shared/posts.rb
rom-sql-1.3.1 spec/shared/posts.rb
rom-sql-1.3.0 spec/shared/posts.rb
rom-sql-1.2.2 spec/shared/posts.rb
rom-sql-1.2.1 spec/shared/posts.rb
rom-sql-1.2.0 spec/shared/posts.rb
rom-sql-1.1.2 spec/shared/posts.rb
rom-sql-1.1.1 spec/shared/posts.rb
rom-sql-1.1.0 spec/shared/posts.rb
rom-sql-1.0.3 spec/shared/posts.rb
rom-sql-1.0.2 spec/shared/posts.rb