mirror of
https://github.com/openSUSE/osem.git
synced 2026-02-07 04:31:00 -05:00
There is a known issue in paper_trail that whenever we Query the 'versions.object' column it evaluates inconsistent results for numeric values due to limitations of SQL wildcard matchers against the serialized objects. So to fix this issue I have manually formed the where query instead of using where_object and where_object_changes. I have also added test for the same. Fixes #1307
27 lines
1.0 KiB
Ruby
27 lines
1.0 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe Admin::EventsController do
|
|
let(:conference) { create(:conference) }
|
|
let(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
|
|
let(:organizer) { create(:user, role_ids: organizer_role.id) }
|
|
let!(:event_without_commercial) { create(:event, program: conference.program) }
|
|
let!(:event_with_commercial) { create(:event, program: conference.program) }
|
|
let!(:event_commercial) { create(:event_commercial, commercialable: event_with_commercial, url: 'https://www.youtube.com/watch?v=M9bq_alk-sw') }
|
|
|
|
with_versioning do
|
|
describe 'GET #show' do
|
|
before :each do
|
|
sign_in(organizer)
|
|
get :show, id: event_without_commercial.id, conference_id: conference.short_title
|
|
end
|
|
|
|
it 'assigns versions' do
|
|
versions = event_without_commercial.versions
|
|
expect(event_without_commercial.id).to eq event_commercial.id
|
|
expect(event_commercial.id).not_to eq event_commercial.commercialable_id
|
|
expect(assigns(:versions)).to eq versions
|
|
end
|
|
end
|
|
end
|
|
end
|