Skip to content

Commit

Permalink
Merge pull request #90 from Fryguy/cleanup_spec_wording
Browse files Browse the repository at this point in the history
Cleanup the spec wording for clarity
  • Loading branch information
chessbyte authored Oct 11, 2017
2 parents 9f52352 + bf1e6c9 commit c307131
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions spec/api/attributes_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe "all tables" do
describe "API" do
let(:connection) { ApplicationRecord.connection }

def api_invalid_tables_message(invalid_tables, attr)
Expand All @@ -11,14 +11,14 @@ def api_invalid_tables_message(invalid_tables, attr)
EOS
end

it "do not have an attribute called href" do
it "no table has an attribute named href" do
href_tables = connection.tables.select do |t|
!%w(schema_migrations ar_internal_metadata).include?(t) && connection.columns(t).any? { |c| c.name == "href" }
end
expect(href_tables.size).to eq(0), api_invalid_tables_message(href_tables, "href")
end

it "do not have an attribute called href_slug" do
it "no table has an attribute named href_slug" do
href_slug_tables = connection.tables.select do |t|
!%w(schema_migrations ar_internal_metadata).include?(t) && connection.columns(t).any? { |c| c.name == "href_slug" }
end
Expand Down
4 changes: 2 additions & 2 deletions spec/replication/util/migration_order_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe "migration order" do
describe "Replication" do
let(:current_release_migrations) do
File.read(File.join(__dir__, 'data/released_migrations')).split.map(&:to_i).sort
end
Expand Down Expand Up @@ -31,7 +31,7 @@ def invalid_migrations_message(incorrect_migration_time_stamps, last_released_mi
EOS
end

it "is correct" do
it "migration order is correct" do
incorrect_migration_time_stamps = []
new_migrations.each do |m|
incorrect_migration_time_stamps << m if m < last_released_migration
Expand Down
4 changes: 2 additions & 2 deletions spec/replication/util/primary_key_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe "all tables" do
describe "Replication" do
let(:connection) { ApplicationRecord.connection }

def invalid_primary_key_message(no_pk)
Expand All @@ -14,7 +14,7 @@ def invalid_primary_key_message(no_pk)
EOS
end

it "have a primary key called id" do
it "all tables have a primary key called id" do
no_pk = []
connection.tables.each do |t|
next if ManageIQ::Schema::Checker::SYSTEM_TABLES.include?(t)
Expand Down
4 changes: 2 additions & 2 deletions spec/replication/util/schema_structure_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe "database schema" do
describe "Replication" do
def invalid_schema_message(message)
<<-EOS.gsub!(/^ +/, "")
#{Rails.configuration.database_configuration[Rails.env]["database"]} is not structured as expected.
Expand All @@ -7,7 +7,7 @@ def invalid_schema_message(message)
EOS
end

it "is structured as expected" do
it "database schema is structured as expected" do
message = ManageIQ::Schema::Checker.check_schema

expect(message).to be_nil, invalid_schema_message(message)
Expand Down

0 comments on commit c307131

Please sign in to comment.