mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Simplify set_week callbacks
Changes to :week are already ignored py paper_trail. No need to wrap this in a `without_versioning`. Also drop the reader in `Registration` and the tests. Why write this into the DB but never read it again? Why test standard ruby/activerecord stuff.
This commit is contained in:
parent
f458736a39
commit
fb2612ecaf
3 changed files with 2 additions and 30 deletions
|
|
@ -40,16 +40,6 @@ describe 'Registration' do
|
|||
describe 'after create' do
|
||||
after { subject.run_callbacks(:create) }
|
||||
|
||||
# set_week and subscribe_to_conference are private methods
|
||||
describe '#set_week' do
|
||||
before { subject.created_at = Time.utc(2014, 5, 10) }
|
||||
|
||||
it 'sets week of registration' do
|
||||
expect(subject).to receive(:set_week)
|
||||
expect(subject.week).to eq 18
|
||||
end
|
||||
end
|
||||
|
||||
describe '#subscribe_to_conference' do
|
||||
it 'subscribes to conference' do
|
||||
expect(subject).to receive(:subscribe_to_conference)
|
||||
|
|
@ -62,14 +52,6 @@ describe 'Registration' do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#week' do
|
||||
before { subject.created_at = Date.new(2014, 06, 30) }
|
||||
|
||||
it 'returns week number of created_at' do
|
||||
expect(subject.week).to eq(26)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'registration_to_events_only_if_present' do
|
||||
context 'valid' do
|
||||
it 'when user registers for events happening while user is at the conference' do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue