Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/conversations/new-conversation-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default Component.extend({
project
});

let conversation = store.createRecord('conversation', { user });
let conversation = store.createRecord('conversation', { user, project });

get(message, 'conversations').pushObject(conversation);

Expand Down
1 change: 1 addition & 0 deletions app/models/conversation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export default Model.extend({

conversationParts: hasMany('conversation-part', { async: true }),
message: belongsTo('message', { async: true }),
project: belongsTo('project', { async: true }),
user: belongsTo('user', { async: true })
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ moduleForComponent('conversations/new-conversation-modal', 'Integration | Compon
});

test('it initiates a conversation and opens the modal when open button is clicked', function(assert) {
assert.expect(6);
assert.expect(7);

let store = get(this, 'store');

Expand All @@ -55,6 +55,7 @@ test('it initiates a conversation and opens the modal when open button is clicke

assert.equal(get(message, 'project.id'), 'foo');
assert.equal(get(message, 'conversations.firstObject.user.id'), 'bar');
assert.equal(get(message, 'conversations.firstObject.project.id'), 'foo');
assert.equal(get(message, 'author.id'), 'baz');
assert.equal(get(message, 'initiatedBy'), 'admin');
});
Expand Down
1 change: 1 addition & 0 deletions tests/unit/models/conversation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ test('it exists', function(assert) {

testForAttributes('conversation', ['insertedAt', 'readAt', 'status', 'updatedAt']);
testForBelongsTo('conversation', 'message');
testForBelongsTo('conversation', 'project');
testForBelongsTo('conversation', 'user');