-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct encode errors when generating .xls
Add specs to test the new exporter. I18n texts for the headers.
- Loading branch information
iagirre
committed
Dec 11, 2017
1 parent
4196e16
commit 146de60
Showing
7 changed files
with
182 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
require 'rails_helper' | ||
require 'events_exporter' | ||
|
||
describe EventsExporter do | ||
let(:exporter) { EventsExporter.new } | ||
|
||
describe '#headers' do | ||
it "generates localized headers" do | ||
expect(exporter.headers.first).to eq('título') | ||
expect(exporter.headers.last).to eq('observaciones generales del gestor') | ||
end | ||
end | ||
|
||
describe '#events_to_row' do | ||
it "generates a row of info based on a event" do | ||
position = create(:position) | ||
event = create(:event, organization_name: "Organization name", position: position) | ||
|
||
row = exporter.event_to_row(event) | ||
|
||
expect(row).to include(event.title) | ||
expect(row).to include(event.description) | ||
expect(row).to include(event.scheduled) | ||
expect(row).to include(event.updated_at) | ||
expect(row).to include(event.user_name) | ||
expect(row).to include(event.position_names) | ||
expect(row).to include(event.location) | ||
expect(row).to include(event.status) | ||
expect(row).to include(event.notes) | ||
expect(row).to include(event.reasons) | ||
expect(row).to include(event.published_at) | ||
expect(row).to include(event.canceled_at) | ||
expect(row).to include(event.organization_name) | ||
expect(row).to include(event.lobby_scheduled) | ||
expect(row).to include(event.general_remarks) | ||
expect(row).to include(event.lobby_contact_firstname) | ||
expect(row).to include(event.lobby_contact_lastname) | ||
expect(row).to include(event.lobby_scheduled) | ||
expect(row).to include(event.general_remarks) | ||
expect(row).to include(event.lobby_contact_phone) | ||
expect(row).to include(event.manager_general_remarks) | ||
|
||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters