Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes serializedRecord on undefined belongsTo relationship #57

Merged
merged 4 commits into from
May 1, 2014

Conversation

brancusi
Copy link
Contributor

Per #37 this adds a check to undefined belongsTo relationships.

@aputinski
Copy link
Collaborator

@brancusi this looks great! would you mind adding a test case or just modifying the test case that checks for the removal of the hasMany relationship?

@brancusi
Copy link
Contributor Author

Great! I'm trying to build a failing test, still working on it. Will hopefully have something soon.

Added test.

1) Checks that a null reference does exist
2) Checks that null ref was removed for final payload
@brancusi
Copy link
Contributor Author

Ok, I was trying to write a test that used find to more closely replicate the problem, but I couldn't figure out how to save a found record.

Below was my condensed attempt... :/

it("has a belongsTo relationship", function(done) {
  Ember.run(function() {
    find.then(function(payload) {
      assert.equal(payload.user, "aputinski");
      done();
    });
  });
});

it("it removes and saves", function(done) {
  Ember.run(function() {
   find.then(function(payload) {
    payload.save().then(function(finalPayload){
         //Do an assert here that all saved.
         done();  
    });
  });
});

Matching existing naming on test
@brancusi
Copy link
Contributor Author

brancusi commented May 1, 2014

Just to clarify, I have a working test in but it's not ideal.

I think maybe my last comment sounded like there is no test yet.

Let me know what you think and if you need me to adjust anything.

Thanks

@aputinski
Copy link
Collaborator

@brancusi sorry about that! I'll get this merged.

aputinski added a commit that referenced this pull request May 1, 2014
Removes serializedRecord on undefined belongsTo relationship
@aputinski aputinski merged commit 91e880c into FirebaseExtended:master May 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants