Skip to content

Commit

Permalink
Improve wording in specs
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez committed Jan 12, 2021
1 parent 5112c99 commit 58efd2c
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions spec/ajax-datatables-rails/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@

describe 'User API' do
describe '#view_columns' do
it 'raises an error if not defined by the user' do
datatable = described_class.new(sample_params)
expect { datatable.view_columns }.to raise_error NotImplementedError
context 'when method is not defined by the user' do
it 'raises an error' do
datatable = described_class.new(sample_params)
expect { datatable.view_columns }.to raise_error NotImplementedError
end
end

context 'child class implements view_columns' do
Expand All @@ -31,16 +33,20 @@
end

describe '#get_raw_records' do
it 'raises an error if not defined by the user' do
datatable = described_class.new(sample_params)
expect { datatable.get_raw_records }.to raise_error NotImplementedError
context 'when method is not defined by the user' do
it 'raises an error' do
datatable = described_class.new(sample_params)
expect { datatable.get_raw_records }.to raise_error NotImplementedError
end
end
end

describe '#data' do
it 'raises an error if not defined by the user' do
datatable = described_class.new(sample_params)
expect { datatable.data }.to raise_error NotImplementedError
context 'when method is not defined by the user' do
it 'raises an error' do
datatable = described_class.new(sample_params)
expect { datatable.data }.to raise_error NotImplementedError
end
end

context 'when data is defined as a hash' do
Expand Down

0 comments on commit 58efd2c

Please sign in to comment.